What is the second argument in array_length() function? What is the second argument in array_length() function? postgresql postgresql

What is the second argument in array_length() function?


That's array's dimension.

Consider an example with a 2D array 3×2:

array_length(array[[1, 2], [3, 4], [5, 6]], 1) ---> 3array_length(array[[1, 2], [3, 4], [5, 6]], 2) ---> 2

The size of the first dimension is 3; the size of the second dimension is 2.