Re: plpgsql: ambiguous column reference in ON CONFLICT clause - Mailing list pgsql-general

From Pavel Stehule
Subject Re: plpgsql: ambiguous column reference in ON CONFLICT clause
Date
Msg-id CAFj8pRBCQDeGozZfczABn3ri=u9_mB+n8SKfaWQOSWr8wuQz3w@mail.gmail.com
Whole thread Raw
In response to Re: plpgsql: ambiguous column reference in ON CONFLICT clause  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-general


po 6. 2. 2023 v 19:02 odesílatel David G. Johnston <david.g.johnston@gmail.com> napsal:
On Monday, February 6, 2023, Torsten Förtsch <tfoertsch123@gmail.com> wrote:

After reading this I am wondering if the current behavior is actually a bug.

Arguably it is a bug, and a known one at that if you want some light reading, but regardless there is presently no proposal to get rid of the POLA violation and little chance for any solution to be back-patched since the issue is lack of good existing technical options.



This is an interesting issue. I fully agree, so it is very pretty unintuitive, but when you start calculating with possibility of expression indexes, it is probably the best that is possible. I don't think it is a bug. Unfortunately, at this moment we have no information about single or double braces usage. So there is not any possibility to say so there should not be an expression's index. And if there can be a functional index, then using a possible variable can be really confusing without unique meaning.

This is probably only one case, where you can specify an index in a query, so there are not any other similar cases, and this special case should be documented and explained in plpgsql doc.

Regards

Pavel




David J.

pgsql-general by date:

Previous
From: Sebastien Flaesch
Date:
Subject: Re: Get the sequence name corresponding to a GENERATED { ALWAYS | BY DEFAULT } AS IDENTITY column
Next
From: veem v
Date:
Subject: Re: Sequence vs UUID