Re: ON CONFLICT DO SELECT (take 3)

Viktor Holmberg <v@viktorh.net>

From: Viktor Holmberg <v@viktorh.net>
To: Dean Rasheed <dean.a.rasheed@gmail.com>, jian he <jian.universality@gmail.com>
Cc: pgsql-hackers@postgresql.org, Marko Tiikkaja <marko@joh.to>, Andreas Karlsson <andreas@proxel.se>
Date: 2025-11-24T15:23:17Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Add support for INSERT ... ON CONFLICT DO SELECT.

  2. doc: Fix statement about ON CONFLICT and deferrable constraints.

  3. Fix ON CONFLICT ON CONSTRAINT during REINDEX CONCURRENTLY

Attachments

On 24 Nov 2025 at 11:39 +0100, Viktor Holmberg <v@viktorh.net>, wrote:
> Got a complication warning in CI: error: ‘lockmode’ may be used uninitialized. Hopefully this fixes it.
It did not. But this will.
For some reason, in this bit:

‘''
LockTupleMode lockmode;
….
case LCS_FORUPDATE:
 lockmode = LockTupleExclusive;
 break;
 case LCS_NONE:
 elog(ERROR, "unexpected lock strength %d", lockStrength);
 }

 if (!ExecOnConflictLockRow(context, existing, conflictTid,
 resultRelInfo->ri_RelationDesc, lockmode, false))
 return false;
‘''

GCC gives warning "error: ‘lockmode’ may be used uninitialized”. But if I switch the final exhaustive “case" to a “default” the warning goes away. Strange, if anyone know how to fix let me know. But also I don’t think it’s a big deal.