In PostgreSQL the array_ndims()
function returns the number of dimensions of an array. We pass the array to the function, and it returns an integer of the number of dimensions in the array.
This function is not to be confused with the array_dims()
function, which returns a more detailed text representation of the dimensions in the array.