Skip site navigation (1) Skip section navigation (2)

Re: NULLS and string concatenation

From: Don Drake <dondrake(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: NULLS and string concatenation
Date: 2004-11-19 20:21:39
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-sql
On Fri, 19 Nov 2004 15:01:42 -0500, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Don Drake <dondrake(at)gmail(dot)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

Thanks for the responses.  I now have a better appreciation for the
SQL standard and PostgreSQL.


In response to

pgsql-sql by date

Next:From: terryDate: 2004-11-20 00:16:53
Subject: Re: NULLS and string concatenation
Previous:From: Terry Lee TuckerDate: 2004-11-19 20:14:32
Subject: Re: NULLS and string concatenation

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group