Re: ON CONFLICT DO SELECT (take 3)

Dean Rasheed <dean.a.rasheed@gmail.com>

From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: jian he <jian.universality@gmail.com>
Cc: Viktor Holmberg <v@viktorh.net>, pgsql-hackers@postgresql.org, Marko Tiikkaja <marko@joh.to>, Andreas Karlsson <andreas@proxel.se>
Date: 2025-11-25T10:04:36Z
Lists: pgsql-hackers
On Tue, 25 Nov 2025 at 08:33, jian he <jian.universality@gmail.com> wrote:
>
> v16-0002: using INJECTION_POINT to test the case when
> ExecOnConflictSelect->ExecOnConflictLockRow returns false.
>

In general, having more tests is a good thing, but I think this is
setting a higher bar for the ON CONFLICT DO SELECT than existing code,
such as ON CONFLICT DO UPDATE. ExecOnConflictUpdate() also uses
ExecOnConflictLockRow() in the same way, and doesn't have such a test,
and there are other lock-and-retry paths in the executor not tested in
this way.

IMO, using injection points for testing a wider variety of possible
race conditions in the executor should be considered as a separate
patch.

Regards,
Dean