X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5543511F662F for ; Mon, 10 Apr 2006 18:37:02 -0300 (ADT) X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Score: 0 X-Spam-Level: X-Spam-Status: No, score=0 required=5 tests=[none] Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id GfguLxGeVhyk for ; Mon, 10 Apr 2006 18:36:52 -0300 (ADT) Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 78DFC11F6645 for ; Mon, 10 Apr 2006 18:36:54 -0300 (ADT) Received: from smtp.well.com (smtp.well.com [206.80.4.7]) by svr4.postgresql.org (Postfix) with ESMTP id E38AE5AF87B for ; Mon, 10 Apr 2006 21:36:54 +0000 (GMT) X-WELL-Auth: Yes Received: from well.com (well.com [206.80.4.5]) by smtp.well.com (8.13.6/8.13.6) with ESMTP id k3ALamSM001837 for ; Mon, 10 Apr 2006 14:36:48 -0700 (PDT) Date: Mon, 10 Apr 2006 14:36:47 -0700 (PDT) From: Neil Harkins To: pgsql-sql@postgresql.org Subject: concatenation with a null column (using ||) nulls the result? Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200604/65 X-Sequence-Number: 24874 inventory=> SELECT cabinets_name, cabinets_description FROM cabinets WHERE cabinets_datacenters = 2; cabinets_name | cabinets_description ---------------+---------------------- 548-4th-Cab2 | 548-4th-RR1 | 548-4th-RR2 | 548-4th-Cab1 | (4 rows) inventory=> SELECT cabinets_name || ' - ' || cabinets_description AS concat FROM cabinets WHERE cabinets_datacenters = 2; concat ----------------- 548-4th-Cab1 - (4 rows) Note: The cabinets_description for the "548-4th-Cab1" row is " ", not NULL, hence it being displayed. Is this standard SQL behavior? Client is from rpm: postgresql-8.0.7-1.FC4.1 Server is from rpm: postgresql-server-8.0.7-1.FC4.1 -neil