Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Correct error message for row-level triggers with transition tables on partitioned...
authorEtsuro Fujita <efujita@postgresql.org>
Fri, 4 Nov 2022 10:15:01 +0000 (19:15 +0900)
committerEtsuro Fujita <efujita@postgresql.org>
Fri, 4 Nov 2022 10:15:01 +0000 (19:15 +0900)
"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

src/backend/commands/trigger.c
src/test/regress/expected/triggers.out

index 6775ea6e01f9bc51dad28e0be0dac1bfa382fa30..36f1082407769a03a1d542fbda036db07ec12bc6 100644 (file)
@@ -262,7 +262,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)
index 8b8eadd181277abb4674c6b65480adb32cb13437..6d80ab1a6d8644a42b5bddf5ec584e6b2e92b741 100644 (file)
@@ -2046,7 +2046,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