Concatenating not working properly - Mailing list pgsql-sql

From Michal Taborsky
Subject Concatenating not working properly
Date
Msg-id 3E94343A.1060108@sh.cvut.cz
Whole thread Raw
Responses Re: Concatenating not working properly  (Tomasz Myrta <jasiek@klaster.net>)
Re: Concatenating not working properly  (Joe Conway <mail@joeconway.com>)
List pgsql-sql
Hello,

I am facing a problem I cannot really explain to myself. I have a table 
with personal data which has columns surname, firstname, secondname, 
title and I want to do a simple select like this:

SELECT (surname || ', ' || firstname || ' ' || secondname) as fullname 
FROM person

For some rows (from what I recognised it is with rows, which have the 
title column empty) it works, for some it returns empty string:

akcent=# SELECT (surname || ', ' || firstname || ' ' || secondname) as 
fullname, title_pre, surname, firstname, secondname FROM person;
       fullname        | title_pre | surname  | firstname | secondname
-----------------------+-----------+----------+-----------+------------                       | Ing.      | Taborsky |
Michal   |                       | Ing.      | Barta    | David     | Novak, Josef          |           | Novak    |
Josef    | Saroch, Adrian Walter |           | Saroch   | Adrian    | Walter
 
(4 rows)

Is that a bug or am I missing something ?

Thanks,
Michal



pgsql-sql by date:

Previous
From: Charles McClain
Date:
Subject: unsubscribe
Next
From: Tom Lane
Date:
Subject: Re: question about visibilty while updating multiple rows .