Re: weird ON CONFLICT clauses

From: Álvaro Herrera <alvherre(at)kurilemu(dot)de>
To: Peter Geoghegan <pg(at)bowt(dot)ie>
Cc: Pg Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: weird ON CONFLICT clauses
Date: 2025-12-12 13:33:50
Message-ID: 202512121327.f2zimsr6guso@alvherre.pgsql
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2025-Nov-27, Peter Geoghegan wrote:

> On Thu, Nov 27, 2025 at 11:00 AM Álvaro Herrera <alvherre(at)kurilemu(dot)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 Content-Type Size
0001-add-Location-to-IndexElem.patch text/x-diff 3.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message tushar 2025-12-12 13:40:02 Re: Non-text mode for pg_dumpall
Previous Message Jasper Smit 2025-12-12 13:19:29 Re: Visibility bug in tuple lock