Re: SQL:2011 Application Time Update & Delete - Mailing list pgsql-hackers

From Paul A Jungwirth
Subject Re: SQL:2011 Application Time Update & Delete
Date
Msg-id CA+renyVkfsrNNnYqLpf_g3mDV31KLFXAw-RRVmyLb7TcBLUO7A@mail.gmail.com
Whole thread
In response to Re: SQL:2011 Application Time Update & Delete  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-hackers
On Tue, Apr 14, 2026 at 10:34 PM Paul A Jungwirth
<pj@illuminatedcomputing.com> wrote:
>
> >  A BEFORE UPDATE trigger that modifies the range column creates overlapping rows. The trigger widening the range
doesn'taffect leftover computation, which uses the original FPO bounds. Result: updated row overlaps both leftovers. 
>
> I'm working on a fix for this. It's not quite ready, but I can finish
> it in the morning. . . .

Actually I think the proper behavior here is to raise an error. We
forbid setting the application-time column when using FOR PORTION OF
(per the standard), so why should we allow a BEFORE trigger to set it?
I think it has the same inconsistency problems. We could support it,
but then why not support both?

Assuming we want to raise an error, I think the best way is to check
the tuple in ExecForPortionOfLeftovers to see if a trigger has
modified it, and in that case raise an error. What do you think?

Yours,

--
Paul              ~{:-)
pj@illuminatedcomputing.com



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: First draft of PG 19 release notes
Next
From: Melanie Plageman
Date:
Subject: Re: First draft of PG 19 release notes