Re: bug or feature, || -operator and NULLs - Mailing list pgsql-hackers

From Csaba Nagy
Subject Re: bug or feature, || -operator and NULLs
Date
Msg-id 1161173711.32342.24.camel@coppola.muc.ecircle.de
Whole thread Raw
In response to bug or feature, || -operator and NULLs  (Andreas Joseph Krogh <andreak@officenet.no>)
Responses Re: bug or feature, || -operator and NULLs  (Andreas Joseph Krogh <andreak@officenet.no>)
List pgsql-hackers
> The following query returns NULL in PG:
> SELECT NULL || 'fisk';
> 
> But in Oracle, it returns 'fisk':
> SELECT NULL || 'fisk' FROM DUAL;
> 
> The latter seems more logical...

Why would it be more logical ?

NULL means "value not known".

Concatenate "value not known" with 'fisk' -> what's the logical answer?

I would say the logical result is 'value not known'... if one of the
components is not known, how can you know what is the result ?

Cheers,
Csaba.




pgsql-hackers by date:

Previous
From: Andreas Joseph Krogh
Date:
Subject: bug or feature, || -operator and NULLs
Next
From: Martijn van Oosterhout
Date:
Subject: Re: Asynchronous I/O Support