Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XNNuT-00036I-JV for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Aug 2014 15:16:17 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XNNuT-0008Ah-2j for pgsql-bugs@arkaria.postgresql.org; Fri, 29 Aug 2014 15:16:17 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XNNuS-00089n-9o for pgsql-bugs@postgresql.org; Fri, 29 Aug 2014 15:16:16 +0000 Received: from sam.nabble.com ([216.139.236.26]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XNNuP-0007Fu-4Z for pgsql-bugs@postgresql.org; Fri, 29 Aug 2014 15:16:14 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1XNNuM-0004ic-8q for pgsql-bugs@postgresql.org; Fri, 29 Aug 2014 08:16:10 -0700 Date: Fri, 29 Aug 2014 08:16:10 -0700 (PDT) From: David G Johnston To: pgsql-bugs@postgresql.org Message-ID: <1409325370266-5816904.post@n5.nabble.com> In-Reply-To: References: <20140828213751.2532.54130@wrigleys.postgresql.org> Subject: Re: BUG #11304: UNION query with NULL values fails MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) 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 Mike Porter wrote > On Thu, 28 Aug 2014, > m.woehling@ > wrote: > >> The following bug has been logged on the website: >> >> Bug reference: 11304 >> Logged by: Markus Woehling >> Email address: > m.woehling@ >> PostgreSQL version: 9.3.5 >> Operating system: Windows Server 2008 >> Description: >> > > select c1 :: integer from (select null as c1 union all select null as c1 > union all select 1 :: text as c1) x; > c1 > ---- > > > 1 > (3 rows) > > select c1 :: integer +1 from (select null as c1 union all select null as > c1 union all select 1 :: text as c1) x; > ?column? > ---------- > > > 2 > (3 rows) > > > (I hate NULL. Just felt like I needed to say that.) > > The above example was run on a 9.2.3 server. Do you have a conclusion/observation to make? NULL + NOT-NULL => NULL Furthermore, since null is valid input for any type, explicit casting between types, if such a cast exists, will always succeed and will always result in null. I agree there is potential for compatibility improvement here but I don't see where your observation fits in. David J. -- View this message in context: http://postgresql.1045698.n5.nabble.com/BUG-11304-UNION-query-with-NULL-values-fails-tp5816830p5816904.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs