Re: BUG #16794: BEFORE UPDATE FOR EACH ROW triggers on partitioned tables can break tuple moving UPDATEs

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: pg(at)pmenke(dot)de, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #16794: BEFORE UPDATE FOR EACH ROW triggers on partitioned tables can break tuple moving UPDATEs
Date: 2021-01-27 00:35:04
Message-ID: 20210127003504.GA17625@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2021-Jan-23, Alvaro Herrera wrote:

> On 2020-Dec-28, PG Bug reporting form wrote:
>
> > i was testing the PG13 enhancement that should allow BEFORE ROW triggers on
> > partitioned tables, as long as they don't move the tuple to a different
> > partition (original thread:
> > https://postgr.es/m/20200227165158.GA2071@alvherre.pgsql). The actual
> > restriction on "not to move the tuple to a different partition" seems to be
> > a bit stronger though, as the trigger fails, even though not itself, but the
> > overarching UPDATE command, did move the tuple.
>
> Hi Philipp, thanks for reporting this issue. Yeah, that should
> definitely work. I'll have a look at this in a couple of days and try
> my best to have a fix for the February minors.

Looked at this today, and it's not nearly as easy to fix as I hoped.
The misbehavior in corner cases seems weird enough that we should keep
the restriction ... but the way the restriction is implemented currently
is completely broken.

--
Álvaro Herrera 39°49'30"S 73°17'W
Si no sabes adonde vas, es muy probable que acabes en otra parte.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Kyotaro Horiguchi 2021-01-27 01:34:35 Re: BUG #16837: Invalid memory access on \h in psql
Previous Message Tom Lane 2021-01-26 16:11:22 Re: BUG #16837: Invalid memory access on \h in psql