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
обсуждение исходный текст
Ответ на 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  (Alex Bolenok <quassnoi@gmail.com>)
Список pgsql-bugs
On Friday, April 15, 2016, Alex Bolenok <quassnoi@gmail.com> 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
Дата:
Сообщение: Re: BUG #14089: ON CONFLICT allows function variables in index expressions
Следующее
От: Noah Misch
Дата:
Сообщение: Re: PostgreSQL on Korean Windows Server 2008 R2 Standard