meta data for this page
PostgreSQL and PostGIS
Tips and snippets
- Display output from a query formatted to terminal width (via StackOverflow):
\pset columns X
, “Be sure, so your pager is well configured - set global variables:”export PAGER=less
export LESS='-iMSx4 -RSFX -e
' - StackOverflow: Test the length of an array in PostgreSQL using
cardinality()
e.g.SELECT a,b,c FROM mytable WHERE cardinality(myarray) > 2