Re: weird ON CONFLICT clauses
Álvaro Herrera <alvherre@kurilemu.de>
From: Álvaro Herrera <alvherre@kurilemu.de>
To: Peter Geoghegan <pg@bowt.ie>
Cc: Pg Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-12-12T13:33:50Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Add parse location to IndexElem.
- 62299bbd90d6 19 (unreleased) landed
-
Reject opclass options in ON CONFLICT clause
- 630a93799d53 19 (unreleased) landed
Attachments
- 0001-add-Location-to-IndexElem.patch (text/x-diff)
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