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

From: Konstantin Knizhnik <k(dot)knizhnik(at)postgrespro(dot)ru>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Using scalar function as set-returning: bug or feature?
Date: 2018-02-09 08:58:30
Message-ID: 249b0957-a326-76e9-3d1c-5b744b4d6cc6@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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.

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

Attachment Content-Type Size
plpgsql.patch text/x-patch 1.1 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Konstantin Knizhnik 2018-02-09 09:19:30 Re: Using scalar function as set-returning: bug or feature?
Previous Message Pantelis Theodosiou 2018-02-09 08:55:26 Re: [HACKERS] FOSDEM PGDay_2018_Developer_Meeting notes