3
3
-- complain if script is sourced in psql, rather than via ALTER EXTENSION
4
4
\echo Use " ALTER EXTENSION pg_wait_sampling UPDATE TO 1.2" to load this file. \quit
5
5
6
- -- DROP FUNCTION pg_wait_sampling_get_current (
7
- -- pid int4,
8
- -- OUT pid int4,
9
- -- OUT event_type text,
10
- -- OUT event text
11
- -- ) CASCADE;
12
- --
13
- -- DROP FUNCTION pg_wait_sampling_get_history (
14
- -- OUT pid int4,
15
- -- OUT ts timestamptz,
16
- -- OUT event_type text,
17
- -- OUT event text
18
- -- ) CASCADE;
19
- --
20
- -- DROP FUNCTION pg_wait_sampling_get_profile (
21
- -- OUT pid int4,
22
- -- OUT event_type text,
23
- -- OUT event text,
24
- -- OUT count bigint
25
- -- ) CASCADE;
6
+ DROP FUNCTION pg_wait_sampling_get_current (
7
+ pid int4,
8
+ OUT pid int4,
9
+ OUT event_type text ,
10
+ OUT event text
11
+ ) CASCADE;
12
+
13
+ DROP FUNCTION pg_wait_sampling_get_history (
14
+ OUT pid int4,
15
+ OUT ts timestamptz ,
16
+ OUT event_type text ,
17
+ OUT event text
18
+ ) CASCADE;
26
19
27
- CREATE FUNCTION pg_wait_sampling_get_current_extended (
20
+ DROP FUNCTION pg_wait_sampling_get_profile (
21
+ OUT pid int4,
22
+ OUT event_type text ,
23
+ OUT event text ,
24
+ OUT count bigint
25
+ ) CASCADE;
26
+
27
+ CREATE FUNCTION pg_wait_sampling_get_current (
28
28
pid int4,
29
29
OUT pid int4,
30
30
OUT event_type text ,
@@ -45,12 +45,12 @@ RETURNS SETOF record
45
45
AS ' MODULE_PATHNAME'
46
46
LANGUAGE C VOLATILE CALLED ON NULL INPUT;
47
47
48
- CREATE VIEW pg_wait_sampling_current_extended AS
49
- SELECT * FROM pg_wait_sampling_get_current_extended (NULL ::integer );
48
+ CREATE VIEW pg_wait_sampling_current AS
49
+ SELECT * FROM pg_wait_sampling_get_current (NULL ::integer );
50
50
51
51
GRANT SELECT ON pg_wait_sampling_current TO PUBLIC;
52
52
53
- CREATE FUNCTION pg_wait_sampling_get_history_extended (
53
+ CREATE FUNCTION pg_wait_sampling_get_history (
54
54
OUT pid int4,
55
55
OUT event_type text ,
56
56
OUT event text ,
@@ -71,12 +71,12 @@ RETURNS SETOF record
71
71
AS ' MODULE_PATHNAME'
72
72
LANGUAGE C VOLATILE STRICT;
73
73
74
- CREATE VIEW pg_wait_sampling_history_extended AS
75
- SELECT * FROM pg_wait_sampling_get_history_extended ();
74
+ CREATE VIEW pg_wait_sampling_history AS
75
+ SELECT * FROM pg_wait_sampling_get_history ();
76
76
77
- GRANT SELECT ON pg_wait_sampling_history_extended TO PUBLIC;
77
+ GRANT SELECT ON pg_wait_sampling_history TO PUBLIC;
78
78
79
- CREATE FUNCTION pg_wait_sampling_get_profile_extended (
79
+ CREATE FUNCTION pg_wait_sampling_get_profile (
80
80
OUT pid int4,
81
81
OUT event_type text ,
82
82
OUT event text ,
@@ -97,10 +97,10 @@ RETURNS SETOF record
97
97
AS ' MODULE_PATHNAME'
98
98
LANGUAGE C VOLATILE STRICT;
99
99
100
- CREATE VIEW pg_wait_sampling_profile_extended AS
101
- SELECT * FROM pg_wait_sampling_get_profile_extended ();
100
+ CREATE VIEW pg_wait_sampling_profile AS
101
+ SELECT * FROM pg_wait_sampling_get_profile ();
102
102
103
- GRANT SELECT ON pg_wait_sampling_profile_extended TO PUBLIC;
103
+ GRANT SELECT ON pg_wait_sampling_profile TO PUBLIC;
104
104
105
105
CREATE FUNCTION pg_wait_sampling_reset_history ()
106
106
RETURNS void
@@ -109,10 +109,3 @@ LANGUAGE C VOLATILE STRICT;
109
109
110
110
-- Don't want this to be available to non-superusers.
111
111
REVOKE ALL ON FUNCTION pg_wait_sampling_reset_history() FROM PUBLIC;
112
-
113
- -- CREATE VIEW pg_wait_sampling_profile AS
114
- -- SELECT pid, event_type, event, queryid, SUM(count) FROM pg_wait_sampling_profile_extended
115
- -- GROUP BY pid, event_type, event, queryid;
116
- --
117
- -- GRANT SELECT ON pg_wait_sampling_profile TO PUBLIC;
118
-
0 commit comments