50 lines
2.3 KiB
Plaintext
50 lines
2.3 KiB
Plaintext
DROP ROLE IF EXISTS su;
|
|
NOTICE: role "su" does not exist, skipping
|
|
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_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_17_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 | 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_version | FUNCTION | text
|
|
public | range | FUNCTION | ARRAY
|
|
(7 rows)
|
|
|
|
SET ROLE su;
|
|
DROP USER u1;
|
|
DROP EXTENSION pg_stat_monitor;
|
|
DROP USER su;
|
|
ERROR: current user cannot be dropped
|