pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Neil Harkins <nharkins@well.com>
To: pgsql-sql@postgresql.org
Subject: concatenation with a null column (using ||) nulls the result?
Date: Mon, 10 Apr 2006 14:36:47 -0700 (PDT)
Message-ID: <Pine.SOL.4.10.10604101430250.2779-100000@well.com> (raw)


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





view thread (5+ messages)  latest in thread

Message-ID: <Pine.SOL.4.10.10604101430250.2779-100000@well.com>
Permalink:  ../Pine.SOL.4.10.10604101430250.2779-100000@well.com/
Also on:    postgresql.org/message-id/Pine.SOL.4.10.10604101430250.2779-100000@well.com

 · 

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: nharkins@well.com
  Subject: Re: concatenation with a null column (using ||) nulls the result?
  In-Reply-To: <Pine.SOL.4.10.10604101430250.2779-100000@well.com>

* 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