Skip to content

Commit ed51bef

Browse files
committed
Revert "Remove obsolete pg_show_plans--1.0.sql file"
This reverts commit 6a17adc. We'll leave the file around in the repository for testing upgrades, but don't install it.
1 parent 825e570 commit ed51bef

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed

pg_show_plans--1.0.sql

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/* pg_show_plans/pg_show_plans--1.0.sql */
2+
3+
-- complain if script is sourced in psql, rather than via CREATE EXTENSION
4+
\echo Use "CREATE EXTENSION pg_show_plans" to load this file. \quit
5+
6+
-- Register functions.
7+
CREATE FUNCTION pg_show_plans_enable()
8+
RETURNS void
9+
AS 'MODULE_PATHNAME'
10+
LANGUAGE C;
11+
12+
CREATE FUNCTION pg_show_plans_disable()
13+
RETURNS void
14+
AS 'MODULE_PATHNAME'
15+
LANGUAGE C;
16+
17+
CREATE FUNCTION pgsp_format_json()
18+
RETURNS void
19+
AS 'MODULE_PATHNAME'
20+
LANGUAGE C;
21+
22+
CREATE FUNCTION pgsp_format_text()
23+
RETURNS void
24+
AS 'MODULE_PATHNAME'
25+
LANGUAGE C;
26+
27+
CREATE FUNCTION pg_show_plans(
28+
OUT pid int8,
29+
OUT level int8,
30+
OUT userid oid,
31+
OUT dbid oid,
32+
OUT plan text
33+
)
34+
RETURNS SETOF record
35+
AS 'MODULE_PATHNAME'
36+
LANGUAGE C;
37+
38+
-- Register a view on the function for ease of use.
39+
CREATE VIEW pg_show_plans AS
40+
SELECT * FROM pg_show_plans();
41+
42+
GRANT SELECT ON pg_show_plans TO PUBLIC;
43+
44+
-- Don't want this to be available to non-superusers.
45+
REVOKE ALL ON FUNCTION pg_show_plans_enable() FROM PUBLIC;
46+
REVOKE ALL ON FUNCTION pg_show_plans_disable() FROM PUBLIC;
47+
REVOKE ALL ON FUNCTION pgsp_format_json() FROM PUBLIC;
48+
REVOKE ALL ON FUNCTION pgsp_format_text() FROM PUBLIC;

0 commit comments

Comments
 (0)