ARRAY NDIMS Function

Education is not limited to just classrooms. It can be gained anytime, anywhere... - Ravi Ranjan (M.Tech-NIT)

PostgreSQL ARRAY_NDIMS() function

ARRAY_NDIMS() function

This function is used to return the number of dimensions of the array.

Syntax :

array_ndims(anyarray)

Return Type :

int

PostgreSQL Version : 9.3

Example : PostgreSQL ARRAY_NDIMS() function

SELECT array_ndims(ARRAY[[1,2,3], [4,5,6]]);

Output :

 array_ndims
-------------
           2
(1 row)