Re: BUG #16140: View with INSERT, DO INSTEAD, and ON CONFLICT causes an error
От | Tom Lane |
---|---|
Тема | Re: BUG #16140: View with INSERT, DO INSTEAD, and ON CONFLICT causes an error |
Дата | |
Msg-id | 11970.1575509408@sss.pgh.pa.us обсуждение исходный текст |
Ответ на | Re: BUG #16140: View with INSERT, DO INSTEAD, and ON CONFLICT causesan error (Peter Geoghegan <pg@bowt.ie>) |
Список | pgsql-bugs |
Peter Geoghegan <pg@bowt.ie> writes: > On Thu, Nov 28, 2019 at 10:26 AM Tom Lane <tgl@sss.pgh.pa.us> wrote: >> You should have written "EXCLUDED.value" not "NEW.value". There is >> a bug here, but it's that the parser accepted this rule. I'm guessing >> that the parsing logic for ON CONFLICT didn't consider the possibility >> that NEW and OLD for a rule would already be in the range table. > I must admit that I have zero recollection of this aspect of the ON > CONFLICT work. Do you think that this would be difficult to fix? Probably not terribly so, but I haven't looked at the code. Partly it'd depend on how good an error message we want (e.g., whether there's to be an error cursor). The likely-simplest fix would involve making sure the rangetable has only the two useful entries, so you'd get some sort of "unknown table name" error for mistakes of this sort. It'd be more useful to say something like "only <table name> and EXCLUDED can be referenced in ON CONFLICT"; but getting to that might be more trouble than it's worth. regards, tom lane
В списке pgsql-bugs по дате отправления: