Re: string || NULL ambiguity

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Oleg Bartunov <oleg(at)sai(dot)msu(dot)su>
Cc: Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: string || NULL ambiguity
Date: 2003-03-19 20:46:40
Message-ID: 20030319204639.GD4207@dcc.uchile.cl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Mar 19, 2003 at 10:26:05PM +0300, Oleg Bartunov wrote:

> we have a little problem in new version of tsearch we're currently
> working. We've implemented concatenation operation for txtidx type
> and treat concatenation with NULL as NULL (as it should be).
> But people get confused with such behaivour. Do we obliged to
> follow NULL rule ? It seems more natural in case of text searching to treat
> stringA||NULL as stringA.

Why don't you just enclose the possibly NULL fields in COALESCE?

stringA||COALESCE(NULL, '')

--
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Para tener mas hay que desear menos"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message mlw 2003-03-19 20:50:31 MySQL at .NET conference
Previous Message Josh Berkus 2003-03-19 20:31:51 Re: PostgreSQL flamage on Slashdot