Re: BUG #15533: error on upsert when used in a fuction and a functionparameter has the same name as the column - Mailing list pgsql-bugs

From Pavel Stehule
Subject Re: BUG #15533: error on upsert when used in a fuction and a functionparameter has the same name as the column
Date
Msg-id CAFj8pRC0+fnc7jRQYbmgAi_HUXbNLXZZBSMSt_rP_Qts_5ZkqQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15533: error on upsert when used in a fuction and a function parameter has the same name as the column  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Responses Re: BUG #15533: error on upsert when used in a fuction and a function parameter has the same name as the column  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
List pgsql-bugs


so 1. 12. 2018 v 12:32 odesílatel Andrew Gierth <andrew@tao11.riddles.org.uk> napsal:
>>>>> "Pavel" == Pavel Stehule <pavel.stehule@gmail.com> writes:

 Pavel> I am strongly sure, so current default is best and any change of
 Pavel> this behave (it is simply - just use #option) is strongly wrong.

I don't buy it; I call this a bug.

Here's why: in an ON CONFLICT (col) clause, the (col) is not a list of
expressions or even really a list of columns, what it is is an index
definition (i.e. the same thing that would appear in CREATE INDEX). One
consequence of this is that _qualified_ column names, which are a usual
solution to variable name vs column conflicts, are not allowed here.
There is already special processing done on the clause for this reason
(the hiding of other tables that might be visible at this point in the
query), and I would say that this simply doesn't go far enough and that
parameters should be hidden too (by suppressing the columnref hooks
while the arbiter clause is being analyzed).

If there a expressions are not accepted there, then I can accept your argumentation. Second hand is a implementation.


--
Andrew (irc:RhodiumToad)

pgsql-bugs by date:

Previous
From: Andrew Gierth
Date:
Subject: Re: BUG #15533: error on upsert when used in a fuction and a function parameter has the same name as the column
Next
From: Andrew Gierth
Date:
Subject: Re: BUG #15533: error on upsert when used in a fuction and a function parameter has the same name as the column