Re: Undocumented array_val[generate_series(...)] functionality? - Mailing list pgsql-general

From David G. Johnston
Subject Re: Undocumented array_val[generate_series(...)] functionality?
Date
Msg-id CAKFQuwYuBGGL90uUCMb3TQB+pSxgvLJVRv_YP5UrUFN_KKj8=A@mail.gmail.com
Whole thread Raw
In response to Re: Undocumented array_val[generate_series(...)] functionality?  (David Rowley <dgrowleyml@gmail.com>)
Responses Re: Undocumented array_val[generate_series(...)] functionality?  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-general
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.  It seems less than helpful to force the reader to infer that, IMO.  Especially when the slice syntax, which could conceivably return either a sub-array OR a set, the later being the undocumented reality (our function examples document the actual outputs, these examples probably should do the same.  I would be OK if we simply added an SRF example and showed the SRF result it produces without changing the wording - though this doesn't seem like a hard improvement to make.  I'll offer something up if a committer at least agrees it could use some work).

David J.

pgsql-general by date:

Previous
From: David Rowley
Date:
Subject: Re: Undocumented array_val[generate_series(...)] functionality?
Next
From: David Rowley
Date:
Subject: Re: Undocumented array_val[generate_series(...)] functionality?