Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>
Cc: Alexander Lakhin <exclusion(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Noah Misch <noah(at)leadboat(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Date: 2025-12-11 20:04:15
Message-ID: 202512111958.6ymanstmexrk@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Dec-09, Mihail Nikalayeu wrote:

> Hello!
>
> After some investigation I ended up with a much simpler fix.
> It is self-explanatory in code and a commit message.

Yeah, that makes sense. It's what I was trying to say in
https://postgr.es/m/202512072050.hcyysny65ugj@alvherre.pgsql
Pushed your patch, thanks.

I still wonder if it's possible to break things by doing something like

CREATE TABLE pt (a int) PARTITION BY LISt (a);
CREATE TABLE p1 PARTITION OF pt FOR VALUES IN (1);
CREATE TABLE p2 PARTITION OF pt FOR VALUES IN (2);
CREATE UNIQUE INDEX pti ON ONLY pt (a);
CREATE UNIQUE INDEX p1i ON p1 (a);
CREATE UNIQUE INDEX p2i ON p2 (a);
ALTER INDEX pti ATTACH PARTITION p1i;

and then do the
INSERT INTO pt VALUES (1) ON CONFLICT (a) DO NOTHING;
dance concurrently with
ALTER INDEX pti ATTACH PARTITION p2i;

This would be a much smaller problem than the already fixed ones though,
I think.

Thanks!

--
Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/
"Learn about compilers. Then everything looks like either a compiler or
a database, and now you have two problems but one of them is fun."
https://twitter.com/thingskatedid/status/1456027786158776329

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2025-12-11 20:05:24 Re: POC: make mxidoff 64 bits
Previous Message Jacob Champion 2025-12-11 19:40:58 Re: Serverside SNI support in libpq