So no array_length function appears to be available in Greenplum. I checked the docs and do not see it in the list. Does anyone have a good, readily available alternative?
gpadmin=# SELECT array_length(array[1,2,3], 1);
ERROR: function array_length(integer[], integer) does not exist
This is what I have come up with so far:
gpadmin=# select array[1,2,3];
array
---------
{1,2,3}
(1 row)
gpadmin=# select array_to_string(array[1,2,3],'');
array_to_string
-----------------
123
(1 row)
gpadmin=# select length(array_to_string(array[1,2,3],''));
length
--------
3
(1 row)
gpadmin=# select length(array_to_string(array[1,2,4,6],''));
length
--------
4
(1 row)
Thanks.