New PostgreSQL 9.6 slice syntax
PostgreSQL arrays support slice operations.
jack=# select ('{a,b,c,d,e,f}'::text[])[2:4];
text
---------
{b,c,d}
New in PostgreSQL 9.6 is slice syntax with implicit lower and upper bounds.
jack=# select ('{a,b,c,d,e,f}'::text[])[:4];
text
-----------
{a,b,c,d}
jack=# select ('{a,b,c,d,e,f}'::text[])[3:];
text
-----------
{c,d,e,f}
Previously, array_lower
and array_upper
was needed to slice from a particular index to the bounds of an array.