From: Etsuro Fujita Date: Fri, 4 Nov 2022 10:15:03 +0000 (+0900) Subject: Correct error message for row-level triggers with transition tables on partitioned... X-Git-Tag: REL_14_6~3 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=1699125ca218d4a035b794eef7c7b8872d10f527;p=postgresql.git 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 86f575948; back-patch to v11 where that commit came in. Reviewed by Tom Lane. Discussion: https://postgr.es/m/CAPmGK17gk4vXLzz2iG%2BG4LWRWCoVyam70nZ3OuGm1hMJwDrhcg%40mail.gmail.com --- diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index 03a3e7afee0..b19f3c8c6da 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -249,7 +249,7 @@ CreateTriggerFiringOn(CreateTrigStmt *stmt, const char *queryString, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("\"%s\" is a partitioned table", RelationGetRelationName(rel)), - errdetail("Triggers on partitioned tables cannot have transition tables."))); + errdetail("ROW triggers with transition tables are not supported on partitioned tables."))); } } else if (rel->rd_rel->relkind == RELKIND_VIEW) diff --git a/src/test/regress/expected/triggers.out b/src/test/regress/expected/triggers.out index 041e5a92dba..d006b8cc631 100644 --- a/src/test/regress/expected/triggers.out +++ b/src/test/regress/expected/triggers.out @@ -2020,7 +2020,7 @@ create trigger failed after update on parted_trig referencing old table as old_table for each row execute procedure trigger_nothing(); ERROR: "parted_trig" is a partitioned table -DETAIL: Triggers on partitioned tables cannot have transition tables. +DETAIL: ROW triggers with transition tables are not supported on partitioned tables. drop table parted_trig; -- -- Verify trigger creation for partitioned tables, and drop behavior