Re: Using scalar function as set-returning: bug or feature?

Поиск
Список
Период
Сортировка
От Konstantin Knizhnik
Тема Re: Using scalar function as set-returning: bug or feature?
Дата
Msg-id 77ae2cdf-0cb2-0227-8253-3f0da3cb7baf@postgrespro.ru
обсуждение исходный текст
Ответ на Re: Using scalar function as set-returning: bug or feature?  (Konstantin Knizhnik <k.knizhnik@postgrespro.ru>)
Список pgsql-hackers


On 09.02.2018 11:58, Konstantin Knizhnik wrote:


On 09.02.2018 11:02, Konstantin Knizhnik wrote:


On 09.02.2018 10:47, Sergei Kornilov wrote:
Hello

select into b from my_insert('from func atx');
You missed select something into b. For example,
select ret into b from my_insert('from func atx') as ret;

Using scalar function in from is not bug.
Silent assigning NULL for variables in "into" not matches same in "select"... I think better would be raise warning.

regards, Sergei
Thank you.
Really the problem is caused by empty source list for INTO.
If I rewrite query as

    select my_insert into b from my_insert('from func atx');

then it works as expected.
But I wonder if the original statement should be considered as error or at least we should produce warning for such empty projections?


Attached please find patch reporting error in case of empty attribute list for SELECT INTO.


Sorry, this patch doesn't correctly handle case:

SELECT INTO [STRICT] target select_expressions FROM ...;

-- 
Konstantin Knizhnik
Postgres Professional: http://www.postgrespro.com
The Russian Postgres Company 

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Konstantin Knizhnik
Дата:
Сообщение: Re: Using scalar function as set-returning: bug or feature?
Следующее
От: Dave Page
Дата:
Сообщение: Re: [HACKERS] FOSDEM PGDay_2018_Developer_Meeting notes