concenation of strings and null values

From: Tino Wildenhain <tino(at)wildenhain(dot)de>
To: Pgsql-General <pgsql-general(at)postgresql(dot)org>
Subject: concenation of strings and null values
Date: 2003-10-07 08:40:49
Message-ID: 3F827C11.3080209@wildenhain.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi,

SELECT 'abc'::text || 'def'::text;

returns 'abcdef' as we know.

SELECT 'abc'::text || ''::text;

returns 'abc'

SELECT 'abc'::text || null::text;

returns null

The last example looks like a bug,
but if it is intentionally so, its
at least very annoying and inconvenient.

Can someone enlighten me if this is
in accordance to some not so transparent
rules of SQL92 or '99 and if so, how
to work around this?

Regards
Tino Wildenhain

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nigel J. Andrews 2003-10-07 09:00:40 Re: concenation of strings and null values
Previous Message Richard Huxton 2003-10-07 07:56:19 Re: COPY COMMAND