Re: Appending null produces null?

From: Alex Pilosov <alex(at)pilosoft(dot)com>
To: Jeff Eckermann <jeckermann(at)verio(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Appending null produces null?
Date: 2000-11-09 15:47:09
Message-ID: Pine.BSO.4.10.10011091046430.2291-100000@spider.pilosoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 9 Nov 2000, Jeff Eckermann wrote:

> extracts=# select bill_address1, bill_address2, bill_address1 || ' ' ||
> bill_address2 from customers where external_id = 20037514;
> bill_address1 | bill_address2 | ?column?
> -----------------+---------------+----------
> 6745 Avalon Ave | |
> (1 row)
>
> I know that the usual operations with 'null' will produce null, but I didn't
> expect it in the case of a text field being appended to another text field.
> No doubt that follows as a matter of strict principle, but the outcome makes
> no sense from a purely practical point of view. Is this really the intended
> behaviour? I know that I can work around this with a 'coalesce' or
> something similar, but that seems unnecessarily messy.
Yes, this is really the intended behavior. Null means 'no value known',
which is different from empty string...

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-11-09 15:47:25 Re: upgrading to 7.0.2
Previous Message Mateusz 2000-11-09 15:41:45 mateo