forked from citusdata/citus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request citusdata#2505 from citusdata/fix_stat_statements_…
…view Fix citus_stat_statements view
- Loading branch information
Showing
6 changed files
with
38 additions
and
3 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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Citus extension | ||
comment = 'Citus distributed database' | ||
default_version = '8.0-11' | ||
default_version = '8.0-12' | ||
module_pathname = '$libdir/citus' | ||
relocatable = false | ||
schema = pg_catalog |
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
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,31 @@ | ||
/* citus--8.0-11--8.0-12 */ | ||
SET search_path = 'pg_catalog'; | ||
|
||
CREATE OR REPLACE FUNCTION pg_catalog.citus_stat_statements(OUT queryid bigint, | ||
OUT userid oid, | ||
OUT dbid oid, | ||
OUT query text, | ||
OUT executor bigint, | ||
OUT partition_key text, | ||
OUT calls bigint) | ||
RETURNS SETOF record | ||
LANGUAGE plpgsql | ||
AS $citus_stat_statements$ | ||
BEGIN | ||
IF EXISTS ( | ||
SELECT extname FROM pg_extension | ||
WHERE extname = 'pg_stat_statements') | ||
THEN | ||
RETURN QUERY SELECT pss.queryid, pss.userid, pss.dbid, pss.query, cqs.executor, | ||
cqs.partition_key, cqs.calls | ||
FROM pg_stat_statements(true) pss | ||
JOIN citus_query_stats() cqs | ||
USING (queryid, userid, dbid); | ||
ELSE | ||
RAISE EXCEPTION 'pg_stat_statements is not installed' | ||
USING HINT = 'install pg_stat_statements extension and try again'; | ||
END IF; | ||
END; | ||
$citus_stat_statements$; | ||
|
||
RESET search_path; |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Citus extension | ||
comment = 'Citus distributed database' | ||
default_version = '8.0-11' | ||
default_version = '8.0-12' | ||
module_pathname = '$libdir/citus' | ||
relocatable = false | ||
schema = pg_catalog |
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
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