UNION with more than 2 branches - Mailing list pgsql-hackers

From Peter Eisentraut
Subject UNION with more than 2 branches
Date
Msg-id 200704241845.56975.peter_e@gmx.net
Whole thread Raw
Responses Re: UNION with more than 2 branches  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
The resolution to my problem with the select_common_type() error message 
turned out to be that this doesn't work:

postgres=# select null union select null union select 1;
ERROR:  UNION types text and integer cannot be matched

That's because it resolves the first two branches independently, then defaults 
to text if it can't find anything better, and then tries to match text to the 
integer in the third branch.

This should probably be fixed sometime.  Maybe make a note in the TODO list?

-- 
Peter Eisentraut
http://developer.postgresql.org/~petere/


pgsql-hackers by date:

Previous
From: August Zajonc
Date:
Subject: Re: Google SoC: column-level privilege subsystem
Next
From: Peter Eisentraut
Date:
Subject: Re: Google SoC: column-level privilege subsystem