Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XNB1U-0005n2-4J for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Aug 2014 01:30:40 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XNB1T-0004H0-Fl for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Aug 2014 01:30:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XN7OQ-0003mA-CK for pgsql-bugs@postgresql.org; Thu, 28 Aug 2014 21:38:06 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XN7OM-0004yP-Ja for pgsql-bugs@postgresql.org; Thu, 28 Aug 2014 21:38:05 +0000 MIME-Version: 1.0 Subject: BUG #11304: UNION query with NULL values fails To: pgsql-bugs@postgresql.org From: m.woehling@barthauer.de Date: Thu, 28 Aug 2014 21:37:51 +0000 Message-ID: <20140828213751.2532.54130@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.1 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs