pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David BOURIAUD <david.bouriaud@ac-rouen.fr>
To: pgsql-sql@postgresql.org
Subject: Is this a feature ?
Date: Tue, 4 Jun 2002 10:18:24 +0200
Message-ID: <200206041018.24328.david.bouriaud@ac-rouen.fr> (raw)

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




view thread (7+ messages)  latest in thread

Message-ID: <200206041018.24328.david.bouriaud@ac-rouen.fr>
Permalink:  ../200206041018.24328.david.bouriaud@ac-rouen.fr/
Also on:    postgresql.org/message-id/200206041018.24328.david.bouriaud@ac-rouen.fr

 · 

reply

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: david.bouriaud@ac-rouen.fr
  Subject: Re: Is this a feature ?
  In-Reply-To: <200206041018.24328.david.bouriaud@ac-rouen.fr>

* 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