Re: bug or feature, || -operator and NULLs

From: Csaba Nagy <nagy(at)ecircle-ag(dot)com>
To: Andreas Joseph Krogh <andreak(at)officenet(dot)no>
Cc: postgres hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: bug or feature, || -operator and NULLs
Date: 2006-10-18 12:15:11
Message-ID: 1161173711.32342.24.camel@coppola.muc.ecircle.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-10-18 12:17:54 Re: Asynchronous I/O Support
Previous Message Magnus Hagander 2006-10-18 12:06:10 Re: [HACKERS] query log corrupted-looking entries