What is the second argument in array_length() function?
arrays, postgresql, postgresql-9.4, sql
Solution
That's array's dimension.
Consider an example with a 2D array 3×2:
array_length(array[[1, 2], [3, 4], [5, 6]], 1) ---> 3
array_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.
Problem
Postgresql 9.4 has functions for array. One of them is `array_length(anyarray, int)`. It get two argumetns. What is the second argument? In all examples it has value `1`. But nowhere says what it is.