Re: weird ON CONFLICT clauses - Mailing list pgsql-hackers

From Álvaro Herrera
Subject Re: weird ON CONFLICT clauses
Date
Msg-id 202512121327.f2zimsr6guso@alvherre.pgsql
Whole thread Raw
In response to Re: weird ON CONFLICT clauses  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
On 2025-Nov-27, Peter Geoghegan wrote:

> On Thu, Nov 27, 2025 at 11:00 AM Álvaro Herrera <alvherre@kurilemu.de> wrote:

> index_elems is needed by ON CONFLICT so that the user can specify an
> operator class and/or a collation. This is probably hardly ever used,
> but it does have its place.

Right.

> > So what about the attached patch?  I ran all tests and everything seems
> > to work correctly.  (Maybe I'd add some tests to verify that this
> > new error is covered, as the ones just above.)  It would complain to the
> > above:
> 
> Seems reasonable to me.

Pushed, thanks for looking.

While looking at the test output, I wondered if it would be useful to
make the error cursor point to the bogus element itself rather than to
the overall InferClause.  At the moment it doesn't look terribly useful,
so I'm parking this patch here; but if somebody were to be motivated to,
say, patch ComputeIndexAttrs to have a ParseState, we could add error
location to the ereports there.

-- 
Álvaro Herrera         PostgreSQL Developer  —  https://www.EnterpriseDB.com/
"Before you were born your parents weren't as boring as they are now. They
got that way paying your bills, cleaning up your room and listening to you
tell them how idealistic you are."  -- Charles J. Sykes' advice to teenagers

Attachment

pgsql-hackers by date:

Previous
From: Jasper Smit
Date:
Subject: Re: Visibility bug in tuple lock
Next
From: tushar
Date:
Subject: Re: Non-text mode for pg_dumpall