Re: BUG #15960: ON CONFLICT Trying accessing to variables
| От | Andres Freund |
|---|---|
| Тема | Re: BUG #15960: ON CONFLICT Trying accessing to variables |
| Дата | |
| Msg-id | 34AB8A8F-1020-4800-9A06-577E038B3C50@anarazel.de обсуждение исходный текст |
| Ответ на | Re: BUG #15960: ON CONFLICT Trying accessing to variables (Peter Geoghegan <pg@bowt.ie>) |
| Ответы |
Re: BUG #15960: ON CONFLICT Trying accessing to variables
|
| Список | pgsql-bugs |
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.
В списке pgsql-bugs по дате отправления: