UNION with more than 2 branches

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: UNION with more than 2 branches
Date: 2007-04-24 16:45:56
Message-ID: 200704241845.56975.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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/

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2007-04-24 16:57:14 Re: Google SoC: column-level privilege subsystem
Previous Message August Zajonc 2007-04-24 16:34:09 Re: Google SoC: column-level privilege subsystem