Re: Undocumented array_val[generate_series(...)] functionality?

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Undocumented array_val[generate_series(...)] functionality?
Дата
Msg-id CAApHDvpWEqS_1OdHLT9X_7YfZuK91mwRFWsmE0LoY4cf-8VJ-A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Undocumented array_val[generate_series(...)] functionality?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Ответы Re: Undocumented array_val[generate_series(...)] functionality?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список pgsql-general
On Mon, 12 Jul 2021 at 12:58, David G. Johnston
<david.g.johnston@gmail.com> wrote:
>
> On Sun, Jul 11, 2021 at 5:43 PM David Rowley <dgrowleyml@gmail.com> wrote:
>>
>> Isn't this implied by "Each subscript is itself an expression"?
>> There's nothing special here with the SRF. That just produces 3 rows
>> and passes the subscript as 1, 2 then 3.
>>
>
> One can indeed infer that if the expression chosen for subscript is an SRF that the resultant output will also be an
SRF.

I'd say in your example the array with the subscript does not become
an SRF anymore than abs() becomes an SRF in the following:

select abs(generate_series(-3,-1));

abs() is simply called once per output value of the generate_series
SRF.  That seems fairly equivalent to me to what's going on in your
example case.

David



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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Undocumented array_val[generate_series(...)] functionality?
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: Removing a subscription that does not exist