Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]

  Powered by Linux