Hi,
On August 15, 2019 9:17:36 AM PDT, Peter Geoghegan <pg@bowt.ie> wrote:
>On Thu, Aug 15, 2019 at 6:28 AM PG Bug reporting form
><noreply@postgresql.org> wrote:
>> Using upsert in stored procedure ON CONFLICT(id, ...) trows "ERROR:
>column
>> reference "id" is ambiguous" where id used as column name and as
>variable,
>> but ON CONFLICT can't use variables
>
>This is not a bug. You must resolve the ambiguity by using a plpgsql
>variable whose name isn't exactly the same as a column name.
I'm not sure I quite buy that. There is no actual ambiguity here. I don't buy the variable referencing a constant -
that'dnot correctly work for subsequent uses of the statement if the variable differs - don't think we'd have replacing
etcset up. Nor do I think we would even evaluate The variable/param.
Seems like it's more a question of preventing the hook from resolving things at that point?
Andres
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.