Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Michail Nikolaev <michail(dot)nikolaev(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Date: 2024-06-24 07:06:21
Message-ID: Znka7eP1LVabX_3l@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jun 17, 2024 at 07:00:51PM +0200, Michail Nikolaev wrote:
> The same issue may happen in case of CREATE/DROP INDEX CONCURRENTLY as well.

While looking at all that, I've been also curious about this specific
point, and it is indeed possible to finish in a state where a
duplicate key would be found in one of indexes selected by the
executor during an INSERT ON CONFLICT while a concurrent set of CICs
and DICs are run, so you don't really need a REINDEX. See for example
the attached test.
--
Michael

Attachment Content-Type Size
test_cic_dic.patch text/x-diff 1.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2024-06-24 07:27:09 Re: Logical Replication of sequences
Previous Message Hayato Kuroda (Fujitsu) 2024-06-24 06:47:54 RE: speed up a logical replica setup