Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 55A3E475CD7 for ; Tue, 4 Jun 2002 10:35:16 -0400 (EDT) Received: from smtp011.mail.yahoo.com (smtp011.mail.yahoo.com [216.136.173.31]) by postgresql.org (Postfix) with SMTP id EB3BC475CA2 for ; Tue, 4 Jun 2002 10:35:14 -0400 (EDT) Received: from unknown (HELO saturn.janwieck.net) (janwieck@192.233.92.205 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 4 Jun 2002 14:35:18 -0000 Received: (from wieck@localhost) by saturn.janwieck.net (8.11.2/8.11.2) id g54EXgE04836; Tue, 4 Jun 2002 10:33:42 -0400 From: Jan Wieck Message-Id: <200206041433.g54EXgE04836@saturn.janwieck.net> Subject: Re: Is this a feature ? In-Reply-To: <200206041018.24328.david.bouriaud@ac-rouen.fr> from David BOURIAUD at "Jun 4, 2002 10:18:24 am" To: David BOURIAUD Date: Tue, 4 Jun 2002 10:33:42 -0400 (EDT) Cc: pgsql-sql@postgresql.org X-Mailer: ELM [version 2.4ME+ PL68 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Archive-Number: 200206/26 X-Sequence-Number: 7991 David, yes, this is a feature, and no, we will not change it. You're missing the difference between empty strings or zero value and SQL NULL values. Do you know (hint, hint) how to use the mailing list archives? Jan David BOURIAUD wrote: > Hi the list ! > I've read the docs, and found that you could concatenate two or more strings > in one select statement like this : > select > civ || name || forname as identity > from > person; > > This just works fine and returns rows with only one column named identity. > So far, if one of the fields (civ, name or forname) is null, identity is > null... That doesn't seems right, since it means that 1+2+0 = 0 !!!! > Has anybody else seen the same strange behaviour ? And is there a way to work > this around ? > Please, don't answer me to use the function textcat (text, text), since it > behaves the same and makes queries quite unreadeable... > eg. > select > textcat ( textcat (civ, name), forname) as identity > from person; > is quite readeable, but when you add fields separator, it isn't. > -- > David BOURIAUD > ---------------------------------------------------------- > In a world without walls or fences, what use do we have > for windows or gates ? > ---------------------------------------------------------- > ICQ#102562021 > > > ---------------------------(end of broadcast)--------------------------- > TIP 4: Don't 'kill -9' the postmaster > -- #======================================================================# # It's easier to get forgiveness for being wrong than for being right. # # Let's break this rule - forgive me. # #================================================== JanWieck@Yahoo.com #