Re: Question

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Robert Partyka <bobson(at)wdg(dot)pl>
Cc: postgres general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question
Date: 2003-10-14 18:16:12
Message-ID: 20031014111440.E73584@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 13 Oct 2003, Robert Partyka wrote:

> why such condition:
> foofield not like '%bar%'
>
> where foofield is varchar
>
> returns false (or rather even ignore row) on record where foofield is
> null

Actually, it probably returns unknown(NULL) on such records.
NULL LIKE '%bar%' is unknown, so
NULL NOT LIKE '%bar%' is also unknown.

This is because NULL isn't the same as empty string, nor is it the absence
of a value, but it's an unknown value.

In response to

  • Question at 2003-10-13 12:55:56 from Robert Partyka

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-10-14 18:19:01 Re: Transaction Queries!!!
Previous Message Peter Eisentraut 2003-10-14 18:14:11 Re: converting varchar date strings to date