BUG #8696: Type-checking seems to fail on UNIONs with arrays - Mailing list pgsql-bugs

From jp.deplaix@gmail.com
Subject BUG #8696: Type-checking seems to fail on UNIONs with arrays
Date
Msg-id E1Vutfw-00071Q-UX@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #8696: Type-checking seems to fail on UNIONs with arrays
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      8696
Logged by:          Jacques-Pascal Deplaix
Email address:      jp.deplaix@gmail.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 ?

pgsql-bugs by date:

Previous
From: "timi"
Date:
Subject: Re: hi,postgresql bug
Next
From: Vik Fearing
Date:
Subject: Re: BUG #8696: Type-checking seems to fail on UNIONs with arrays