1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
/* contrib/pg_wait_sampling/pg_wait_sampling--1.0--1.1.sql */
DROP FUNCTION pg_wait_sampling_get_current (
pid int4,
OUT pid int4,
OUT event_type text,
OUT event text
) CASCADE;
DROP FUNCTION pg_wait_sampling_get_history (
OUT pid int4,
OUT ts timestamptz,
OUT event_type text,
OUT event text
) CASCADE;
DROP FUNCTION pg_wait_sampling_get_profile (
OUT pid int4,
OUT event_type text,
OUT event text,
OUT count bigint
) CASCADE;
CREATE FUNCTION pg_wait_sampling_get_current (
pid int4,
OUT pid int4,
OUT event_type text,
OUT event text,
OUT queryid int8
)
RETURNS SETOF record
AS 'MODULE_PATHNAME'
LANGUAGE C VOLATILE CALLED ON NULL INPUT;
CREATE VIEW pg_wait_sampling_current AS
SELECT * FROM pg_wait_sampling_get_current(NULL::integer);
GRANT SELECT ON pg_wait_sampling_current TO PUBLIC;
CREATE FUNCTION pg_wait_sampling_get_history (
OUT pid int4,
OUT ts timestamptz,
OUT event_type text,
OUT event text,
OUT queryid int8
)
RETURNS SETOF record
AS 'MODULE_PATHNAME'
LANGUAGE C VOLATILE STRICT;
CREATE VIEW pg_wait_sampling_history AS
SELECT * FROM pg_wait_sampling_get_history();
GRANT SELECT ON pg_wait_sampling_history TO PUBLIC;
CREATE FUNCTION pg_wait_sampling_get_profile (
OUT pid int4,
OUT event_type text,
OUT event text,
OUT queryid int8,
OUT count int8
)
RETURNS SETOF record
AS 'MODULE_PATHNAME'
LANGUAGE C VOLATILE STRICT;
CREATE VIEW pg_wait_sampling_profile AS
SELECT * FROM pg_wait_sampling_get_profile();
GRANT SELECT ON pg_wait_sampling_profile TO PUBLIC;
|