BUG #11304: UNION query with NULL values fails

From: m(dot)woehling(at)barthauer(dot)de
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #11304: UNION query with NULL values fails
Date: 2014-08-28 21:37:51
Message-ID: 20140828213751.2532.54130@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 11304
Logged by: Markus Woehling
Email address: m(dot)woehling(at)barthauer(dot)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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2014-08-28 22:24:30 Re: Error with citext extension when upgrading from 9.0.3 to 9.3.5: 'cannot cast type oid[] to oidvector'
Previous Message digoal 2014-08-28 08:39:29 BUG #11283: PostgreSQL bug? function's variable type cached not flushed within session when the type altered.