X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 278A53A4AC5 for ; Fri, 19 Nov 2004 22:28:51 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30010-01 for ; Fri, 19 Nov 2004 22:28:42 +0000 (GMT) Received: from wproxy.gmail.com (wproxy.gmail.com [64.233.184.195]) by svr1.postgresql.org (Postfix) with ESMTP id A22583A4B69 for ; Fri, 19 Nov 2004 20:48:19 +0000 (GMT) Received: by wproxy.gmail.com with SMTP id 71so71452wra for ; Fri, 19 Nov 2004 12:48:19 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:references; b=e7E+e1Ti/69sm1VZZORIm7ZLOPxuHqfplz+2CXSWw9RYWfWvIq62oitFAyt/83+QzwSkiTAYeF8LD2cpfPkamjYfnggRL0Nlsp9zbFzcer4aMey4WSPvcK2fEi3WhIzPFbbcz1Wm48PWqXwwIQu5uTDSXvAxfZ2pvWSNnoA3NcA= Received: by 10.54.4.26 with SMTP id 26mr416762wrd; Fri, 19 Nov 2004 12:21:39 -0800 (PST) Received: by 10.54.52.30 with HTTP; Fri, 19 Nov 2004 12:21:39 -0800 (PST) Message-ID: <6c21003b0411191221325695ad@mail.gmail.com> Date: Fri, 19 Nov 2004 14:21:39 -0600 From: Don Drake Reply-To: Don Drake To: pgsql-sql@postgresql.org Subject: Re: NULLS and string concatenation In-Reply-To: <13631.1100894502@sss.pgh.pa.us> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit References: <6c21003b0411190912630d4afe@mail.gmail.com> <419E31F2.4060104@archonet.com> <6c21003b041119104039c88faf@mail.gmail.com> <13631.1100894502@sss.pgh.pa.us> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200411/209 X-Sequence-Number: 19528 On Fri, 19 Nov 2004 15:01:42 -0500, Tom Lane wrote: > Don Drake 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 , General Rule 2a: > > a) If either S1 or S2 is the null value, then the result of the > is the null value. > > regards, tom lane > Thanks for the responses. I now have a better appreciation for the SQL standard and PostgreSQL. -Don