PG-558: Create test case to verify the function names and count in PGSM.
parent
5cd4f255d1
commit
1037fb08a8
2
Makefile
2
Makefile
|
@ -12,7 +12,7 @@ LDFLAGS_SL += $(filter -lm, $(LIBS))
|
|||
|
||||
TAP_TESTS = 1
|
||||
REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/pg_stat_monitor/pg_stat_monitor.conf --inputdir=regression
|
||||
REGRESS = basic version guc counters relations database error_insert application_name application_name_unique top_query cmd_type error rows tags
|
||||
REGRESS = basic version guc functions counters relations database error_insert application_name application_name_unique top_query cmd_type error rows tags
|
||||
|
||||
# Disabled because these tests require "shared_preload_libraries=pg_stat_statements",
|
||||
# which typical installcheck users do not have (e.g. buildfarm clients).
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
CREATE USER su WITH SUPERUSER;
|
||||
SET ROLE su;
|
||||
CREATE EXTENSION pg_stat_monitor;
|
||||
CREATE USER u1;
|
||||
SELECT pg_stat_monitor_reset();
|
||||
pg_stat_monitor_reset
|
||||
-----------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
SELECT routine_schema, routine_name, routine_type, data_type FROM information_schema.routines WHERE routine_schema = 'public' ORDER BY routine_name COLLATE "C";
|
||||
routine_schema | routine_name | routine_type | data_type
|
||||
----------------+--------------------------+--------------+-----------
|
||||
public | decode_error_level | FUNCTION | text
|
||||
public | get_cmd_type | FUNCTION | text
|
||||
public | get_histogram_timings | FUNCTION | text
|
||||
public | histogram | FUNCTION | record
|
||||
public | pg_stat_monitor_internal | FUNCTION | record
|
||||
public | pg_stat_monitor_reset | FUNCTION | void
|
||||
public | pg_stat_monitor_settings | FUNCTION | record
|
||||
public | pg_stat_monitor_version | FUNCTION | text
|
||||
public | pgsm_create_11_view | FUNCTION | integer
|
||||
public | pgsm_create_13_view | FUNCTION | integer
|
||||
public | pgsm_create_14_view | FUNCTION | integer
|
||||
public | pgsm_create_15_view | FUNCTION | integer
|
||||
public | pgsm_create_view | FUNCTION | integer
|
||||
public | range | FUNCTION | ARRAY
|
||||
(14 rows)
|
||||
|
||||
SET ROLE u1;
|
||||
SELECT routine_schema, routine_name, routine_type, data_type FROM information_schema.routines WHERE routine_schema = 'public' ORDER BY routine_name COLLATE "C";
|
||||
routine_schema | routine_name | routine_type | data_type
|
||||
----------------+-------------------------+--------------+-----------
|
||||
public | histogram | FUNCTION | record
|
||||
public | pg_stat_monitor_reset | FUNCTION | void
|
||||
public | pg_stat_monitor_version | FUNCTION | text
|
||||
(3 rows)
|
||||
|
||||
set role su;
|
||||
DROP USER u1;
|
||||
DROP EXTENSION pg_stat_monitor;
|
|
@ -0,0 +1,15 @@
|
|||
CREATE USER su WITH SUPERUSER;
|
||||
SET ROLE su;
|
||||
|
||||
CREATE EXTENSION pg_stat_monitor;
|
||||
CREATE USER u1;
|
||||
|
||||
SELECT pg_stat_monitor_reset();
|
||||
SELECT routine_schema, routine_name, routine_type, data_type FROM information_schema.routines WHERE routine_schema = 'public' ORDER BY routine_name COLLATE "C";
|
||||
|
||||
SET ROLE u1;
|
||||
SELECT routine_schema, routine_name, routine_type, data_type FROM information_schema.routines WHERE routine_schema = 'public' ORDER BY routine_name COLLATE "C";
|
||||
|
||||
set role su;
|
||||
DROP USER u1;
|
||||
DROP EXTENSION pg_stat_monitor;
|
Loading…
Reference in New Issue