pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David G Johnston <david.g.johnston@gmail.com>
To: pgsql-bugs@postgresql.org
Subject: Re: BUG #11304: UNION query with NULL values fails
Date: Fri, 29 Aug 2014 08:16:10 -0700 (PDT)
Message-ID: <1409325370266-5816904.post@n5.nabble.com> (raw)
In-Reply-To: <alpine.OSX.2.00.1408291033210.78223@enva.aff.hqry.rqh>
References: <20140828213751.2532.54130@wrigleys.postgresql.org>
	<alpine.OSX.2.00.1408291033210.78223@enva.aff.hqry.rqh>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

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-tp5816830p58169...
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



view thread (4+ messages)  latest in thread

Message-ID: <1409325370266-5816904.post@n5.nabble.com>
Permalink:  ../1409325370266-5816904.post@n5.nabble.com/
Also on:    postgresql.org/message-id/1409325370266-5816904.post@n5.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: david.g.johnston@gmail.com
  Subject: Re: BUG #11304: UNION query with NULL values fails
  In-Reply-To: <1409325370266-5816904.post@n5.nabble.com>
  References: <20140828213751.2532.54130@wrigleys.postgresql.org> <alpine.OSX.2.00.1408291033210.78223@enva.aff.hqry.rqh> <1409325370266-5816904.post@n5.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox