Skip to content

Commit

Permalink
Revert "Remove obsolete pg_show_plans--1.0.sql file"
Browse files Browse the repository at this point in the history
This reverts commit 6a17adc.

We'll leave the file around in the repository for testing upgrades, but
don't install it.
  • Loading branch information
df7cb committed Mar 28, 2023
1 parent 825e570 commit ed51bef
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions pg_show_plans--1.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/* pg_show_plans/pg_show_plans--1.0.sql */

-- complain if script is sourced in psql, rather than via CREATE EXTENSION
\echo Use "CREATE EXTENSION pg_show_plans" to load this file. \quit

-- Register functions.
CREATE FUNCTION pg_show_plans_enable()
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C;

CREATE FUNCTION pg_show_plans_disable()
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C;

CREATE FUNCTION pgsp_format_json()
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C;

CREATE FUNCTION pgsp_format_text()
RETURNS void
AS 'MODULE_PATHNAME'
LANGUAGE C;

CREATE FUNCTION pg_show_plans(
OUT pid int8,
OUT level int8,
OUT userid oid,
OUT dbid oid,
OUT plan text
)
RETURNS SETOF record
AS 'MODULE_PATHNAME'
LANGUAGE C;

-- Register a view on the function for ease of use.
CREATE VIEW pg_show_plans AS
SELECT * FROM pg_show_plans();

GRANT SELECT ON pg_show_plans TO PUBLIC;

-- Don't want this to be available to non-superusers.
REVOKE ALL ON FUNCTION pg_show_plans_enable() FROM PUBLIC;
REVOKE ALL ON FUNCTION pg_show_plans_disable() FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsp_format_json() FROM PUBLIC;
REVOKE ALL ON FUNCTION pgsp_format_text() FROM PUBLIC;

0 comments on commit ed51bef

Please sign in to comment.