Skip to content

Commit 2bcb2b5

Browse files
committed
Fix migration script
1 parent 910c3ec commit 2bcb2b5

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

pg_wait_sampling--1.0--1.1.sql

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,21 @@ DROP FUNCTION pg_wait_sampling_get_current (
55
OUT pid int4,
66
OUT event_type text,
77
OUT event text
8-
);
8+
) CASCADE;
99

1010
DROP FUNCTION pg_wait_sampling_get_history (
1111
OUT pid int4,
1212
OUT ts timestamptz,
1313
OUT event_type text,
1414
OUT event text
15-
);
15+
) CASCADE;
1616

1717
DROP FUNCTION pg_wait_sampling_get_profile (
1818
OUT pid int4,
1919
OUT event_type text,
2020
OUT event text,
2121
OUT count bigint
22-
);
22+
) CASCADE;
2323

2424
CREATE FUNCTION pg_wait_sampling_get_current (
2525
pid int4,
@@ -32,6 +32,11 @@ RETURNS SETOF record
3232
AS 'MODULE_PATHNAME'
3333
LANGUAGE C VOLATILE CALLED ON NULL INPUT;
3434

35+
CREATE VIEW pg_wait_sampling_current AS
36+
SELECT * FROM pg_wait_sampling_get_current(NULL::integer);
37+
38+
GRANT SELECT ON pg_wait_sampling_current TO PUBLIC;
39+
3540
CREATE FUNCTION pg_wait_sampling_get_history (
3641
OUT pid int4,
3742
OUT ts timestamptz,
@@ -43,6 +48,11 @@ RETURNS SETOF record
4348
AS 'MODULE_PATHNAME'
4449
LANGUAGE C VOLATILE STRICT;
4550

51+
CREATE VIEW pg_wait_sampling_history AS
52+
SELECT * FROM pg_wait_sampling_get_history();
53+
54+
GRANT SELECT ON pg_wait_sampling_history TO PUBLIC;
55+
4656
CREATE FUNCTION pg_wait_sampling_get_profile (
4757
OUT pid int4,
4858
OUT event_type text,
@@ -53,3 +63,8 @@ CREATE FUNCTION pg_wait_sampling_get_profile (
5363
RETURNS SETOF record
5464
AS 'MODULE_PATHNAME'
5565
LANGUAGE C VOLATILE STRICT;
66+
67+
CREATE VIEW pg_wait_sampling_profile AS
68+
SELECT * FROM pg_wait_sampling_get_profile();
69+
70+
GRANT SELECT ON pg_wait_sampling_profile TO PUBLIC;

pg_wait_sampling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ pg_wait_sampling_get_history(PG_FUNCTION_ARGS)
770770
*/
771771
static PlannedStmt *
772772
pgws_planner_hook(Query *parse, int cursorOptions,
773-
ParamListInfo boundParams)
773+
ParamListInfo boundParams)
774774
{
775775
if (MyProc)
776776
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy