Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 5287247621A for ; Tue, 4 Jun 2002 04:34:17 -0400 (EDT) Received: from matrix.gatewaynet.com (unknown [217.19.69.50]) by postgresql.org (Postfix) with ESMTP id 13C59475ABD for ; Tue, 4 Jun 2002 04:32:00 -0400 (EDT) Received: from localhost (achill@localhost) by matrix.gatewaynet.com (8.11.6/8.11.6) with ESMTP id g548WDi12635; Tue, 4 Jun 2002 11:32:13 +0300 Date: Tue, 4 Jun 2002 11:32:13 +0300 (EEST) From: Achilleus Mantzios To: David BOURIAUD Cc: pgsql-sql@postgresql.org Subject: Re: Is this a feature ? In-Reply-To: <200206041018.24328.david.bouriaud@ac-rouen.fr> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200206/22 X-Sequence-Number: 7987 On Tue, 4 Jun 2002, David BOURIAUD wrote: I think is indeed is a feature! Use coalesce. > 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. > -- Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt tel: +30-10-8981112 fax: +30-10-8981877 email: achill@matrix.gatewaynet.com mantzios@softlab.ece.ntua.gr