Re: [GENERAL] Where is IFNULL?

From: "Gene Selkov Jr(dot)" <selkovjr(at)selkovjr(dot)xnet(dot)com>
To: Sascha Ziemann <szi(at)khs-ag(dot)de>
Cc: pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Where is IFNULL?
Date: 1999-12-07 21:17:16
Message-ID: 199912072108.PAA29174@mail.xnet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> Hi,
>
> the user manual describes the function IFNULL on page 38, but when I
> try to use it I get the following error:
>
> users=> select ifnull (NULL, 'nix');
> ERROR: No such function 'ifnull' with the specified attributes

The manual seems to be obsolete. The related functions are named
nullvalue and nonnullvalue, but neither takes more than one argument.

Actually, there is a SQL syntactic sugar for null/not null:

diagrams=> select 1 is not null;
?column?
--------
t
(1 row)

diagrams=> select 1 is null;
?column?
--------
f
(1 row)

'1 is null' is equivalent to 'nullvalue(1)'

> Or does anybody know a simple way to concatenate strings, which can be
> NULL?

Don't know the answer to this, but it appears to be wrong not to
ignore NULLs in concatenation. Why not trust this job to your client-side
code?

--Gene

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Heflin 1999-12-07 21:42:09 Re: [GENERAL] viewing dbs
Previous Message Kevin Heflin 1999-12-07 21:16:45 viewing dbs