Skip to content

Commit a2c4d28

Browse files
committed
Upgrade extension version to 1.1
We need to bump since pgsp_format_yaml and pgsp_format_xml were added.
1 parent f799419 commit a2c4d28

File tree

5 files changed

+83
-22
lines changed

5 files changed

+83
-22
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ MODULE_big = pg_show_plans
44
OBJS = pg_show_plans.o
55

66
EXTENSION = pg_show_plans
7-
DATA = pg_show_plans--1.0.sql
7+
DATA = pg_show_plans--1.0--1.1.sql \
8+
pg_show_plans--1.1.sql
89
REGRESS = pg_show_plans formats
910

1011
USE_PGXS = 1

pg_show_plans--1.0--1.1.sql

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CREATE FUNCTION pgsp_format_yaml()
2+
RETURNS void
3+
AS 'MODULE_PATHNAME'
4+
LANGUAGE C;
5+
6+
CREATE FUNCTION pgsp_format_xml()
7+
RETURNS void
8+
AS 'MODULE_PATHNAME'
9+
LANGUAGE C;
10+
11+
REVOKE ALL ON FUNCTION pgsp_format_yaml() FROM PUBLIC;
12+
REVOKE ALL ON FUNCTION pgsp_format_xml() FROM PUBLIC;

pg_show_plans--1.0.sql

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,35 @@ RETURNS void
1414
AS 'MODULE_PATHNAME'
1515
LANGUAGE C;
1616

17-
CREATE FUNCTION pgsp_format_text()
18-
RETURNS void
19-
AS 'MODULE_PATHNAME'
20-
LANGUAGE C;
21-
2217
CREATE FUNCTION pgsp_format_json()
2318
RETURNS void
2419
AS 'MODULE_PATHNAME'
2520
LANGUAGE C;
2621

27-
CREATE FUNCTION pgsp_format_yaml()
28-
RETURNS void
29-
AS 'MODULE_PATHNAME'
30-
LANGUAGE C;
31-
32-
CREATE FUNCTION pgsp_format_xml()
22+
CREATE FUNCTION pgsp_format_text()
3323
RETURNS void
3424
AS 'MODULE_PATHNAME'
3525
LANGUAGE C;
3626

3727
CREATE FUNCTION pg_show_plans(
38-
OUT pid int8,
39-
OUT level int8,
40-
OUT userid oid,
41-
OUT dbid oid,
42-
OUT plan text
28+
OUT pid int8,
29+
OUT level int8,
30+
OUT userid oid,
31+
OUT dbid oid,
32+
OUT plan text
4333
)
4434
RETURNS SETOF record
4535
AS 'MODULE_PATHNAME'
4636
LANGUAGE C;
4737

4838
-- Register a view on the function for ease of use.
4939
CREATE VIEW pg_show_plans AS
50-
SELECT * FROM pg_show_plans();
40+
SELECT * FROM pg_show_plans();
5141

5242
GRANT SELECT ON pg_show_plans TO PUBLIC;
5343

5444
-- Don't want this to be available to non-superusers.
5545
REVOKE ALL ON FUNCTION pg_show_plans_enable() FROM PUBLIC;
5646
REVOKE ALL ON FUNCTION pg_show_plans_disable() FROM PUBLIC;
57-
REVOKE ALL ON FUNCTION pgsp_format_text() FROM PUBLIC;
5847
REVOKE ALL ON FUNCTION pgsp_format_json() FROM PUBLIC;
59-
REVOKE ALL ON FUNCTION pgsp_format_yaml() FROM PUBLIC;
60-
REVOKE ALL ON FUNCTION pgsp_format_xml() FROM PUBLIC;
48+
REVOKE ALL ON FUNCTION pgsp_format_text() FROM PUBLIC;

pg_show_plans--1.1.sql

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
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_text()
18+
RETURNS void
19+
AS 'MODULE_PATHNAME'
20+
LANGUAGE C;
21+
22+
CREATE FUNCTION pgsp_format_json()
23+
RETURNS void
24+
AS 'MODULE_PATHNAME'
25+
LANGUAGE C;
26+
27+
CREATE FUNCTION pgsp_format_yaml()
28+
RETURNS void
29+
AS 'MODULE_PATHNAME'
30+
LANGUAGE C;
31+
32+
CREATE FUNCTION pgsp_format_xml()
33+
RETURNS void
34+
AS 'MODULE_PATHNAME'
35+
LANGUAGE C;
36+
37+
CREATE FUNCTION pg_show_plans(
38+
OUT pid int8,
39+
OUT level int8,
40+
OUT userid oid,
41+
OUT dbid oid,
42+
OUT plan text
43+
)
44+
RETURNS SETOF record
45+
AS 'MODULE_PATHNAME'
46+
LANGUAGE C;
47+
48+
-- Register a view on the function for ease of use.
49+
CREATE VIEW pg_show_plans AS
50+
SELECT * FROM pg_show_plans();
51+
52+
GRANT SELECT ON pg_show_plans TO PUBLIC;
53+
54+
-- Don't want this to be available to non-superusers.
55+
REVOKE ALL ON FUNCTION pg_show_plans_enable() FROM PUBLIC;
56+
REVOKE ALL ON FUNCTION pg_show_plans_disable() FROM PUBLIC;
57+
REVOKE ALL ON FUNCTION pgsp_format_text() FROM PUBLIC;
58+
REVOKE ALL ON FUNCTION pgsp_format_json() FROM PUBLIC;
59+
REVOKE ALL ON FUNCTION pgsp_format_yaml() FROM PUBLIC;
60+
REVOKE ALL ON FUNCTION pgsp_format_xml() FROM PUBLIC;

pg_show_plans.control

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# pg_show_plans extension
22
comment = 'show query plans of all currently running SQL statements'
3-
default_version = '1.0'
3+
default_version = '1.1'
44
module_pathname = '$libdir/pg_show_plans'
55
relocatable = true

0 commit comments

Comments
 (0)