diff --git a/src/backend/catalog/information_schema.sql b/src/backend/catalog/information_schema.sql index cb775683fa..3e07fb107e 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 13bbddf785..09691d8357 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