BUG #11304: UNION query with NULL values fails - Mailing list pgsql-bugs

From m.woehling@barthauer.de
Subject BUG #11304: UNION query with NULL values fails
Date
Msg-id 20140828213751.2532.54130@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #11304: UNION query with NULL values fails
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      11304
Logged by:          Markus Woehling
Email address:      m.woehling@barthauer.de
PostgreSQL version: 9.3.5
Operating system:   Windows Server 2008
Description:

I want to "warm up" the bug reports "BUG #1453"
[http://permalink.gmane.org/gmane.comp.db.postgresql.bugs/7383] and "BUG
#5974"
[http://www.postgresql.org/message-id/201104122018.p3CKIlWR042915@wwwmaster.postgresql.org].

I need to build UNION queries with NULL values dynamically like in this
sample:
select null union all select null union all select 1;

This could be workaround:
select null union all (select null union all select 1);

But this workaround fails in this case:
select 1 union all (select null union all select null);

Because I don't know the "real" data type of the NULL values, I can't
specify the type like in this sample:
select 1 union all (select null::int union all select null::int);

I know that MSSQL, Oracle, MySQL, DB2 and Firebird don't have this problem.
So I'd really like to see this working in PostgreSQL as well.
Currently this problem hinders me from using PostgreSQL as DBMS in our
products.

Markus

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Error with citext extension when upgrading from 9.0.3 to 9.3.5: 'cannot cast type oid[] to oidvector'
Next
From: Heikki Linnakangas
Date:
Subject: Re: BUG #11280: Segmentation fault in dataPlaceToPageLeaf at gindatapage.c:645