From: | Amit Langote <amitlangote09(at)gmail(dot)com> |
---|---|
To: | Petr Fedorov <petr(dot)fedorov(at)phystech(dot)edu> |
Cc: | PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com> |
Subject: | Re: A row-level trigger on a partitioned table is not created on a sub-partition created later |
Date: | 2019-12-18 02:11:39 |
Message-ID: | CA+HiwqFM2=i+uHB9o4OkLbE2S3sjPHoVe2wXuAD1GLJ4+Pk9eg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Hello,
On Thu, Dec 5, 2019 at 4:24 PM Petr Fedorov <petr(dot)fedorov(at)phystech(dot)edu> wrote:
> create table level1 (id1 integer not null, id2 integer not null, id3 integer not null) partition by list (id2);
> create or replace function trigger_func() returns trigger language 'plpgsql' as $body$ begin raise exception 'fired'; return null; end $body$;
> create trigger test_trigger after insert on level1 for each row execute procedure trigger_func();
>
> create table level2 partition of level1 for values in (1) partition by list (id3);
> create table level3 partition of level2 for values in (1);
>
> insert into level1 values (1,1,1); -- row inserted
>
> psql \d+ shows that level3 does not have row level trigger while level2 and level1 have.
That is a bug. :(
Alvaro, isn't marking triggers cloned to partitions "internal"
unnecessary? Because the cloned trigger on partition (level2 in above
example) is marked internal, CloneRowTriggersToPartition() skips it
when called on a sub-partition (level3 in above example).
Attached patch to fix that passes make check, although a bit surprised
that it does.
Thanks,
Amit
Attachment | Content-Type | Size |
---|---|---|
dont-mark-cloned-triggers-internal.patch | text/plain | 5.1 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Kaijiang Chen | 2019-12-18 03:23:37 | Re: weird long time query |
Previous Message | Amit Langote | 2019-12-18 01:34:53 | Re: BUG #16163: Seq scan through all the partitions on a partitioned table when joined small, dictionary table. |