X-Original-To: pgsql-sql@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id A80F3475ECE for ; Wed, 9 Apr 2003 10:55:26 -0400 (EDT) Received: from service.sh.cvut.cz (service.sh.cvut.cz [147.32.127.214]) by postgresql.org (Postfix) with ESMTP id 8C5B7475EC9 for ; Wed, 9 Apr 2003 10:55:25 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by service.sh.cvut.cz (Postfix) with ESMTP id D5BE11B81E7 for ; Wed, 9 Apr 2003 16:55:29 +0200 (CEST) Received: from service.sh.cvut.cz ([127.0.0.1]) by localhost (service [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 08287-02 for ; Wed, 9 Apr 2003 16:55:29 +0200 (CEST) Received: from notorola.sh.cvut.cz (notorola.sh.cvut.cz [147.32.127.197]) by service.sh.cvut.cz (Postfix) with SMTP id 06E0A1B80A0 for ; Wed, 9 Apr 2003 16:55:29 +0200 (CEST) Received: (qmail 16196 invoked from network); 9 Apr 2003 14:55:28 -0000 Received: from whizz.sh.cvut.cz (HELO sh.cvut.cz) (147.32.113.3) by notorola.sh.cvut.cz with SMTP; 9 Apr 2003 14:55:28 -0000 Message-ID: <3E94343A.1060108@sh.cvut.cz> Date: Wed, 09 Apr 2003 16:54:50 +0200 From: Michal Taborsky User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; cs-CZ; rv:1.3) Gecko/20030312 X-Accept-Language: cs, en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Concatenating not working properly Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at sh.cvut.cz X-Spam-Status: No, hits=-12.4 required=5.0 tests=BAYES_01,RCVD_IN_OSIRUSOFT_COM,USER_AGENT_MOZILLA_UA autolearn=ham version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/133 X-Sequence-Number: 12834 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