Re: - Mailing list pgsql-general

From Daniel Schuchardt
Subject Re:
Date
Msg-id 000001c38805$76576980$6500a8c0@DSVAIO
Whole thread Raw
In response to Re:  (Richard Huxton <dev@archonet.com>)
Responses Re:  (Alexander Litvinov <lan@ac-sw.com>)
Re:  (Oliver Elphick <olly@lfix.co.uk>)
List pgsql-general
But CAST(NULL AS VARCHAR) should make it a varchar so i should be able
to || the both values. So perhaps a bug in CAST.

The only way here would be to make a CASE WHEN - i think thats not a
good behavoir.

Daniel

On Wednesday 01 October 2003 10:57, Daniel Schuchardt wrote:
> Hi @ all,
>
> I think thats a bug:
>
> SELECT '#' || '#'
>
> will work but
>
> SELECT '#' || CAST(NULL AS VARCHAR)

Nope - not a bug.

> will return only empty rows.
> My Query looks like this : SELECT field1 || field2 FROM ... If field2
> ISNULL then everything is null. CAST does not help.

Broadly speaking VALUE op NULL = NULL
You'll see similar issues with comparisons. You might find the article
below
useful:

http://techdocs.postgresql.org/guides/BriefGuideToNulls



pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re:
Next
From: Stefan Leitich
Date:
Subject: adressing column