Contents
array_ndims()
A function returning the number of dimensions of an array
array_ndims()
is a system function returning the number of dimensions of an array.
array_ndims()
was added in PostgreSQL 8.4.
Examples
Basic usage example for array_ndims()
:
postgres=# SELECT array_ndims(ARRAY[1,2,3]); array_ndims ------------- 1 (1 row)
With a multi-dimensional array:
postgres=# SELECT array_ndims(ARRAY[ [1,2,3],[4,5,6] ]); array_ndims ------------- 2 (1 row)
References
- PostgreSQL documentation: Array Functions