The following bug has been logged on the website:
Bug reference: 6326
Logged by: Maksym Boguk
Email address: maxim(dot)boguk(at)gmail(dot)com
PostgreSQL version: 9.1.1
Operating system: Linux
Description:
SELECT ARRAY(SELECT ...)
doesn't work when subselect return any array.
Test case:
db=# SELECT ARRAY(SELECT 1 UNION ALL SELECT 2);
?column?
----------
{1,2}
All good... now:
db=# SELECT ARRAY(SELECT array[1,2]::float[] UNION ALL SELECT
array[3,4]::float[]);
ERROR: could not find array type for data type double precision[]
db=# SELECT ARRAY(SELECT array[1,2]::integer[] UNION ALL SELECT
array[3,4]::integer[]);
ERROR: could not find array type for data type integer[]
Is that syntax supposed to work with anyarray types?