Re: BUG #14089: ON CONFLICT allows function variables in index expressions
От
David G. Johnston
Тема
Re: BUG #14089: ON CONFLICT allows function variables in index expressions
Дата
Msg-id
CAKFQuwbob2Ko=XfovDvx4WdS=+TnBBJEwkjfzk0GC5Czucevcg@mail.gmail.com
Ответ на
Список
Дерево обсуждения
BUG #14089: ON CONFLICT allows function variables in index expressions quassnoi@gmail.com
Re: BUG #14089: ON CONFLICT allows function variables in index expressions "David G. Johnston" <david.g.johnston@gmail.com>
Re: BUG #14089: ON CONFLICT allows function variables in index expressions Alex Bolenok <quassnoi@gmail.com>
Re: BUG #14089: ON CONFLICT allows function variables in index expressions "David G. Johnston" <david.g.johnston@gmail.com>
Re: BUG #14089: ON CONFLICT allows function variables in index expressions Alex Bolenok <quassnoi@gmail.com>
Re: BUG #14089: ON CONFLICT allows function variables in index expressions "David G. Johnston" <david.g.johnston@gmail.com>
Re: BUG #14089: ON CONFLICT allows function variables in index expressions Peter Geoghegan <pg@heroku.com>
Re: BUG #14089: ON CONFLICT allows function variables in index expressions Peter Geoghegan <pg@heroku.com>
On Friday, April 15, 2016, Alex Bolenok wrote: > The function should not even compile, as the INSERT query before it does > not: > > test=# INSERT INTO test (value) SELECT * FROM (VALUES (1)) q (n) ON > CONFLICT > (value, (n)) DO NOTHING; > ERROR: column "n" does not exist > > The parser should only allow the target table's column names and constants > in the index expression, as it does when creating the index. A variable > name is neither. > > The parsed insert never see the letter "n". Once you comprehend that fact your statement is true - because of the word "constant". That constant is why it compiles. David J.
В списке pgsql-bugs по дате отправления
От: Alex Bolenok
Дата: