Thread
Commits
-
Correct error message for row-level triggers with transition tables on partitioned tables.
- 6f47756d6fa8 11.18 landed
- 572695bcbcbd 12.13 landed
- 26c1cab4c9fa 13.9 landed
- 1699125ca218 14.6 landed
- 81173264440d 15.1 landed
- 8c7146790811 16.0 landed
-
Error for row-level triggers with transition tables on partitioned tables
Etsuro Fujita <etsuro.fujita@gmail.com> — 2022-10-31T09:27:53Z
While working on something else, I noticed $SUBJECT: we do not currently allow row-level triggers on partitioned tables to have transition tables like this: create table parted_trig (a int) partition by list (a); CREATE TABLE create function trigger_nothing() returns trigger language plpgsql as $$ begin end; $$; CREATE FUNCTION 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. but the DETAIL message is confusing, because statement-level triggers on partitioned tables *can* have transition tables. We do not currently allow row-level triggers on partitions to have transition tables either, and the error message for that is “ROW triggers with transition tables are not supported on partitions.”. How about changing the DETAIL message to something similar to this like “ROW triggers with transition tables are not supported on partitioned tables.”, to avoid confusion? Patch attached. Will add this to the upcoming CF. Best regards, Etsuro Fujita
-
Re: Error for row-level triggers with transition tables on partitioned tables
Tom Lane <tgl@sss.pgh.pa.us> — 2022-11-02T17:20:28Z
Etsuro Fujita <etsuro.fujita@gmail.com> writes: > We do not currently allow row-level triggers on partitions to have > transition tables either, and the error message for that is “ROW > triggers with transition tables are not supported on partitions.”. > How about changing the DETAIL message to something similar to this > like “ROW triggers with transition tables are not supported on > partitioned tables.”, to avoid confusion? Patch attached. Will add > this to the upcoming CF. +1, this wording is better. I marked it RFC. regards, tom lane
-
Re: Error for row-level triggers with transition tables on partitioned tables
Etsuro Fujita <etsuro.fujita@gmail.com> — 2022-11-04T10:45:45Z
On Thu, Nov 3, 2022 at 2:20 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: > Etsuro Fujita <etsuro.fujita@gmail.com> writes: > > We do not currently allow row-level triggers on partitions to have > > transition tables either, and the error message for that is “ROW > > triggers with transition tables are not supported on partitions.”. > > How about changing the DETAIL message to something similar to this > > like “ROW triggers with transition tables are not supported on > > partitioned tables.”, to avoid confusion? Patch attached. Will add > > this to the upcoming CF. > > +1, this wording is better. I marked it RFC. Cool! I have committed the patch. Thanks for reviewing! Best regards, Etsuro Fujita