Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY - Mailing list pgsql-hackers

From Mihail Nikalayeu
Subject Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY
Date
Msg-id CADzfLwUdP6kS+kKbVE6kOrz6CwYCuK6oU2HWNOvZ-z1TBtcweQ@mail.gmail.com
Whole thread Raw
In response to Re: Issues with ON CONFLICT UPDATE and REINDEX CONCURRENTLY  (Álvaro Herrera <alvherre@kurilemu.de>)
List pgsql-hackers
Hello!

On Fri, Nov 28, 2025 at 6:30 PM Álvaro Herrera <alvherre@kurilemu.de> wrote:
> I wasn't happy with the idea of opening all indexes twice in
> infer_arbiter_indexes(), so I instead made it collect all Relations from
> those indexes in an initial loop, then process them in the two places
> that wanted them, and we close them all again together.  I think this
> also makes the code clearer.  We no longer have the "next" goto label to
> close the index at the bottom of the loop, but instead we can just do
> "continue" cleanly.

Yes, agreed - that looks better than my version.

Few moments:

> Second, if an attribute list was specified in the ON
>* CONFLICT clause, we use the list to find the indexes whose attributes
>* match that list.
I think we may notice expressions and predicates also.

> /*
> * Find the named constraint index to extract its attributes and
> * predicates.
> */
> foreach_ptr(RelationData, idxRel, indexRelList)

Should we consider assert to ensure we have actually found something?

Best regards,
Mikhail.



pgsql-hackers by date:

Previous
From: Andrey Borodin
Date:
Subject: Re: IPC/MultixactCreation on the Standby server
Next
From: Marcos Pegoraro
Date:
Subject: Re: [PoC] XMLCast (SQL/XML X025)