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+renyXRGM5g7f7eVH2oHaaf_MdR4EqAbj6An3McrSrAiTFebQ@mail.gmail.com
Whole thread Raw
In response to Re: SQL:2011 Application Time Update & Delete  (Paul A Jungwirth <pj@illuminatedcomputing.com>)
List pgsql-hackers
On Tue, Nov 4, 2025 at 11:12 AM Paul A Jungwirth
<pj@illuminatedcomputing.com> wrote:
> Back to Postgres, you can get "desired" results IN READ COMMITTED by
> explicitly locking rows (with SELECT FOR UPDATE) just before
> updating/deleting them. Since you acquire the lock before the
> update/delete starts, there can be no new leftovers created within
> that span of history, and the update/delete sees everything that is
> there.

I forgot to mention: possibly we'll want to use this approach for
{CASCADE,SET {NULL,DEFAULT}} foreign keys (if the transaction is READ
COMMITTED). I'll explore that more and add it to the patch in this
series if it seems necessary. Also I didn't consider whether the
regular DML's lock could be weaker, like just KEY SHARE.

Yours,

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



pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: [BUG] PostgreSQL crashes with ThreadSanitizer during early initialization
Next
From: Tom Lane
Date:
Subject: Re: [BUG] PostgreSQL crashes with ThreadSanitizer during early initialization