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.