-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |