array_dims()

A function returning a text representation of an array's dimensions

array_dims() is a system function returning a textual representation of an array's dimensions.

array_dims() has always been present in PostgreSQL.

Usage

array_dims ( anyarray ) → text

Examples

Basic execution example for array_dims():

postgres=# SELECT array_dims(ARRAY[1,2,3]);
 array_dims 
------------
 [1:3]
(1 row)

With a multi-dimensional array:

postgres=# SELECT array_dims(ARRAY[ [1,2,3],[4,5,6] ]);
 array_dims 
------------
 [1:2][1:3]
(1 row)

Categories

Arrays, System function

See also

array_ndims(), array_lower(), array_upper(), cardinality()