Re: [SQL] problem with select - Mailing list pgsql-sql

From Tom Lane
Subject Re: [SQL] problem with select
Date
Msg-id 15130.936106283@sss.pgh.pa.us
Whole thread Raw
In response to Re: [SQL] problem with select  (Holm Tiffe <holm@freibergnet.de>)
List pgsql-sql
Holm Tiffe <holm@freibergnet.de> writes:
> It is almost working, my database isn't that big that memory becomes a
> problem; the machine has 512MB.
> But why is nothing found if one value of a column contains NULL ?

Because nulls propagate: any operator whose input is NULL produces NULL.
The only things that don't return NULL are the special syntaxes IS NULL,
IS NOT NULL, and CASE expressions using them (in particular the CASE
shortcuts COALESCE, etc).

You probably want to write COALESCE(field, '') in place of just field
for any column that can be NULL.
        regards, tom lane


pgsql-sql by date:

Previous
From: Holm Tiffe
Date:
Subject: Re: [SQL] problem with select
Next
From: José Soares
Date:
Subject: Re: [SQL] problem with select