Re: string || NULL ambiguity - Mailing list pgsql-hackers

From Oleg Bartunov
Subject Re: string || NULL ambiguity
Date
Msg-id Pine.GSO.4.53.0303200430410.23995@ra.sai.msu.su
Whole thread Raw
In response to Re: string || NULL ambiguity  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: string || NULL ambiguity  ("Thomas T. Thai" <tom@minnesota.com>)
Re: string || NULL ambiguity  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
On Wed, 19 Mar 2003, Alvaro Herrera wrote:

> 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, '')
>

we don't know in advance if it's NULL or not.

>
Regards,    Oleg
_____________________________________________________________
Oleg Bartunov, sci.researcher, hostmaster of AstroNet,
Sternberg Astronomical Institute, Moscow University (Russia)
Internet: oleg@sai.msu.su, http://www.sai.msu.su/~megera/
phone: +007(095)939-16-83, +007(095)939-23-83


pgsql-hackers by date:

Previous
From: snpe
Date:
Subject: Re: cursors outside transactions
Next
From: "Christopher Kings-Lynne"
Date:
Subject: Re: MySQL at .NET conference