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

From David G. Johnston
Subject Undocumented array_val[generate_series(...)] functionality?
Date
Msg-id CAKFQuwaMq8xwBoJzW_gGVrDj0hvCf2V7Z2bJEZkkNodZnayOVQ@mail.gmail.com
Whole thread Raw
Responses Re: Undocumented array_val[generate_series(...)] functionality?  (Rob Sargent <robjsargent@gmail.com>)
Re: Undocumented array_val[generate_series(...)] functionality?  (David Rowley <dgrowleyml@gmail.com>)
List pgsql-general
Hey,

A post over in Reddit had an expression form I've never seen before:

select (array[1,2,3,4]::integer[])[generate_series(1, 3)];
===
1
2
3

Looking at subscripting in the SQL syntax this example doesn't seem to be documented.


Is it documented somewhere else, and, regardless, shouldn't it be documented in the linked location?

I get this is basically a variant of the slice syntax [n:m], and it is working as expected, but nothing indicates I can put an SRF inside the brackets.

David J.

pgsql-general by date:

Previous
From: Jakub Jedelsky
Date:
Subject: libicu global support
Next
From: Rob Sargent
Date:
Subject: Re: Undocumented array_val[generate_series(...)] functionality?