aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/catalog/information_schema.sql11
-rw-r--r--src/include/catalog/catversion.h2
2 files changed, 10 insertions, 3 deletions
diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql
index cb775683fa5..3e07fb107eb 100644
--- a/src/backend/catalog/information_schema.sql
+++ b/src/backend/catalog/information_schema.sql
@@ -2046,8 +2046,15 @@ CREATE VIEW triggers AS
CAST(
-- To determine action order, partition by schema, table,
-- event_manipulation (INSERT/DELETE/UPDATE), ROW/STATEMENT (1),
- -- BEFORE/AFTER (66), then order by trigger name
- rank() OVER (PARTITION BY n.oid, c.oid, em.num, t.tgtype & 1, t.tgtype & 66 ORDER BY t.tgname)
+ -- BEFORE/AFTER (66), then order by trigger name. It's preferable
+ -- to partition by view output columns, so that query constraints
+ -- can be pushed down below the window function.
+ rank() OVER (PARTITION BY CAST(n.nspname AS sql_identifier),
+ CAST(c.relname AS sql_identifier),
+ em.num,
+ t.tgtype & 1,
+ t.tgtype & 66
+ ORDER BY t.tgname)
AS cardinal_number) AS action_order,
CAST(
CASE WHEN pg_has_role(c.relowner, 'USAGE')
diff --git a/src/include/catalog/catversion.h b/src/include/catalog/catversion.h
index 13bbddf785e..09691d83578 100644
--- a/src/include/catalog/catversion.h
+++ b/src/include/catalog/catversion.h
@@ -53,6 +53,6 @@
*/
/* yyyymmddN */
-#define CATALOG_VERSION_NO 202004074
+#define CATALOG_VERSION_NO 202004241
#endif