On Sun, 2026-03-08 at 15:15 +0000, [email protected] wrote:
> This is pure speculation.
> It's possible that using SELECT FOR UPDATE also locks the rows in the parent 
> tables referenced in the field list.
> I believe this happened in older versions of PostgreSQL.

I thought about that too, but since both updates affect the same table,
the foreign key would have to reference the table itself.

You are right that a SELECT ... FOR UPDATE will place a lock on any
referenced row (and FOR UPDATE will probably use a lock that is too
strong!), but those locks would still be SHARE locks, which can
coexist.

Yours,
Laurenz Albe


Reply via email to