SELECT array_to_max('{}'::float[]); array_to_max -------------- (1 row) SELECT array_to_max('{1,1,5,2,0}'::smallint[]); array_to_max -------------- 5 (1 row) SELECT array_to_max('{1,1,5,2,0}'::integer[]); array_to_max -------------- 5 (1 row) SELECT array_to_max('{1,1,5,2,0}'::bigint[]); array_to_max -------------- 5 (1 row) SELECT array_to_max('{1,1,5,2,0}'::real[]); array_to_max -------------- 5 (1 row) SELECT array_to_max('{1,1,5,2,0}'::float[]); array_to_max -------------- 5 (1 row) SELECT array_to_max('{1,1,5,2,0}'::text[]); ERROR: Max subject must be SMALLINT, INTEGER, BIGINT, REAL, or DOUBLE PRECISION values SELECT array_to_max('{NULL}'::float[]); array_to_max -------------- (1 row) SELECT array_to_max('{1,1,NULL,2,0}'::float[]); array_to_max -------------- 2 (1 row) SELECT array_to_max('{NULL,-1,-1,-2}'::float[]); array_to_max -------------- -1 (1 row) SELECT array_to_max('{-1,-1,-2,NULL}'::float[]); array_to_max -------------- -1 (1 row)