Skip to content

Commit 19c2931

Browse files
Etsuro Fujitareshke
authored andcommitted
Correct error message for row-level triggers with transition tables on partitioned tables.
"Triggers on partitioned tables cannot have transition tables." is incorrect as we allow statement-level triggers on partitioned tables to have transition tables. This has been wrong since commit 86f5759; back-patch to v11 where that commit came in. Reviewed by Tom Lane. Discussion: https://postgr.es/m/CAPmGK17gk4vXLzz2iG%2BG4LWRWCoVyam70nZ3OuGm1hMJwDrhcg%40mail.gmail.com
1 parent 749fb12 commit 19c2931

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

src/backend/commands/trigger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ CreateTriggerFiringOn(CreateTrigStmt *stmt, const char *queryString,
254254
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
255255
errmsg("\"%s\" is a partitioned table",
256256
RelationGetRelationName(rel)),
257-
errdetail("Triggers on partitioned tables cannot have transition tables.")));
257+
errdetail("ROW triggers with transition tables are not supported on partitioned tables.")));
258258
}
259259
}
260260
else if (rel->rd_rel->relkind == RELKIND_VIEW)

src/test/regress/expected/triggers.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,7 @@ create trigger failed after update on parted_trig
18981898
referencing old table as old_table
18991899
for each row execute procedure trigger_nothing();
19001900
ERROR: "parted_trig" is a partitioned table
1901-
DETAIL: Triggers on partitioned tables cannot have transition tables.
1901+
DETAIL: ROW triggers with transition tables are not supported on partitioned tables.
19021902
drop table parted_trig;
19031903
--
19041904
-- Verify trigger creation for partitioned tables, and drop behavior

src/test/singlenode_regress/expected/triggers.out

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ create trigger failed after update on parted_trig
19131913
referencing old table as old_table
19141914
for each row execute procedure trigger_nothing();
19151915
ERROR: "parted_trig" is a partitioned table
1916-
DETAIL: Triggers on partitioned tables cannot have transition tables.
1916+
DETAIL: ROW triggers with transition tables are not supported on partitioned tables.
19171917
drop table parted_trig;
19181918
--
19191919
-- Verify trigger creation for partitioned tables, and drop behavior

0 commit comments

Comments
 (0)