The following bug has been logged on the website:
Bug reference: 8696
Logged by: Jacques-Pascal Deplaix
Email address: jp(dot)deplaix(at)gmail(dot)com
PostgreSQL version: 9.3.2
Operating system: Linux
Description:
Hi,
I'm wondering why the following examples works:
(SELECT NULL AS test)
UNION
(SELECT array_agg(t.name) AS test FROM foo AS t)
;
(SELECT NULL AS test)
UNION
(SELECT array_agg(t.name) AS test FROM foo AS t)
UNION
(SELECT NULL AS test)
;
but this one:
(SELECT NULL AS test)
UNION
(SELECT NULL AS test)
UNION
(SELECT array_agg(t.name) AS test FROM foo AS t)
;
fails with:
ERROR: UNION types text and text[] cannot be matched
Is it (as I suppose) a bug or a well known limitation ?