Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

From: Noah Misch <noah(at)leadboat(dot)com>
To: Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Date: 2025-11-02 23:21:05
Message-ID: 20251102232105.a3@rfd.leadboat.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 28, 2025 at 02:19:00AM +0100, Mihail Nikalayeu wrote:
> On Mon, Oct 27, 2025 at 7:06 PM Noah Misch <noah(at)leadboat(dot)com> wrote:
> > Yes, I'm happy to push a patch documenting it. Would you like to propose the
> > specific doc patch? I regret lacking the bandwidth to review the fix patches.
>
> Of course!
>
> First version in attachment, waiting for your comment.

Thanks. Does "ON CONFLICT ON CONSTRAINT constraint_name" avoid the problem w/
concurrent REINDEX CONCURRENTLY? A search of the thread found no mention of
"ON CONSTRAINT". It seems safe to assume that clause would avoid problems w/
CREATE INDEX CONCURRENTLY, but that's less certain for REINDEX.

The attached version has these changes:

- Mention ON CONSTRAINT as a workaround. Will remove if you find or suspect
it's not effective.
- Limit the doc change to ON CONFLICT. I think mentioning it at the INDEX
commands is undue emphasis.
- Use term "unique violation", a term used earlier on the same page, instead
of "duplicate key ...".
- Remove the internals-focused point about the brief window.
- Remove some detail I considered insufficiently surprising, e.g. the point
about "compatible with the index being built".

Attachment Content-Type Size
doc-concurrently-on-conflict-v2nm.patch text/plain 1.1 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joshua Shanks 2025-11-02 23:30:01 Re: Fix typo in Vietnamese translation file
Previous Message Tom Lane 2025-11-02 22:52:12 Re: Fix typo in Vietnamese translation file