Merge pull request #333 from Naeem-Akhter/PG-558

PG-558: Create test case to verify the function names and count in PGSM.
pull/335/head
Ibrar Ahmed 2022-12-13 16:29:52 +05:00 committed by GitHub
commit a6099d6a84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 57 additions and 1 deletions

View File

@ -12,7 +12,7 @@ LDFLAGS_SL += $(filter -lm, $(LIBS))
TAP_TESTS = 1 TAP_TESTS = 1
REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/pg_stat_monitor/pg_stat_monitor.conf --inputdir=regression 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", # Disabled because these tests require "shared_preload_libraries=pg_stat_statements",
# which typical installcheck users do not have (e.g. buildfarm clients). # which typical installcheck users do not have (e.g. buildfarm clients).

View File

@ -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;

View File

@ -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;