Re: A row-level trigger on a partitioned table is not created on a sub-partition created later

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Amit Langote <amitlangote09(at)gmail(dot)com>
Cc: Petr Fedorov <petr(dot)fedorov(at)phystech(dot)edu>, PostgreSQL mailing lists <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: A row-level trigger on a partitioned table is not created on a sub-partition created later
Date: 2019-12-27 22:18:26
Message-ID: 20191227221826.GA2547@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2019-Dec-27, Alvaro Herrera wrote:

> Working on getting your fix pushed now.

Ran out of time for today, but I added this test that reproduces the
issue -- fails without your patch, and works with it.

One thing I just realized is that in next minors' release notes we
should publish a recipe to fix catalogs for existing databases, unless
we go for a fix that doesn't require changing the catalogs -- I don't
know what that would be, though, but maybe it would not be totally
insane to clone even internal triggers in the cases that matter.

(I wonder if a better solution for the master branch would involve a new
pg_trigger column that indicates the parent trigger for a cloned
trigger. That would avoid pg_dump's new subquery. Also: would it be
better to use pg_partition_ancestors instead of the sub-subquery?
... though that doesn't work in pg11 ...)

--
Álvaro Herrera https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

Attachment Content-Type Size
trigtest.patch text/x-diff 3.9 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2019-12-27 22:36:56 Re: BUG #16059: Tab-completion of filenames in COPY commands removes required quotes
Previous Message Alvaro Herrera 2019-12-27 21:37:34 Re: A row-level trigger on a partitioned table is not created on a sub-partition created later