From: Tom Lane <tgl@sss.pgh.pa.us>
To: Don Drake <dondrake@gmail.com>
Cc: Richard Huxton <dev@archonet.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: NULLS and string concatenation
Date: Fri, 19 Nov 2004 15:01:42 -0500
Message-ID: <13631.1100894502@sss.pgh.pa.us> (raw)
In-Reply-To: <6c21003b041119104039c88faf@mail.gmail.com>
References: <6c21003b0411190912630d4afe@mail.gmail.com>
<419E31F2.4060104@archonet.com>
<6c21003b041119104039c88faf@mail.gmail.com>
Don Drake <dondrake@gmail.com> writes:
> This is still strange to me. In Oracle, the same query would not
> replace the *entire* string with a NULL, it treats the NULL as a no
> value.
Oracle is a bit, um, standards-challenged. They fail to make a
distinction between an empty string and a NULL, but such a distinction
is both logically necessary and required by the SQL standard.
> I can't find in the documentation where string concatenation of any
> string and NULL is NULL.
SQL92 section 6.13 <string value expression>, General Rule 2a:
a) If either S1 or S2 is the null value, then the result of the
<concatenation> is the null value.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, dondrake@gmail.com, dev@archonet.com
Subject: Re: NULLS and string concatenation
In-Reply-To: <13631.1100894502@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox