w3resource

PostgreSQL ARRAY_UPPER() function

ARRAY_UPPER() function

This function is used to return upper bound of the requested array dimension.

Syntax:

array_upper(anyarray, int)

Return Type:

int

PostgreSQL Version: 9.3

Example: PostgreSQL ARRAY_UPPER() function

Code:

SELECT array_upper(ARRAY[1,3,3,5], 1);

Sample Output:

 array_upper
-------------
           4
(1 row)

Previous: ARRAY_TO_STRING function
Next: STRING_TO_ARRAY function



Follow us on Facebook and Twitter for latest update.