concenation of strings and null values

Tino Wildenhain <tino@wildenhain.de>

From: Tino Wildenhain <tino@wildenhain.de>
To: Pgsql-General <pgsql-general@postgresql.org>
Date: 2003-10-07T08:40:49Z
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