Re: regexp on null

From: Richard Broersma <richard(dot)broersma(at)gmail(dot)com>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: regexp on null
Date: 2010-09-10 16:19:01
Message-ID: AANLkTimp1xrMXTUKMBs2ESr0z-KtTJamvA7E2K6SwE-Y@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Sep 10, 2010 at 9:00 AM, Gauthier, Dave <dave(dot)gauthier(at)intel(dot)com> wrote:

> Is there a way to regexp match on a null value?

I would say no.

>  Or is it necessary to OR in a .... "or x is null"?

you could use a

COALESCE( text_column, '') ~ E'MyRegEx';

Or perhaps:
( text_column ~ E'MyRegEx' ) IS UNKNOWN
might work.

--
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2010-09-10 16:56:32 Re: regexp on null
Previous Message Dmitriy Igrishin 2010-09-10 16:14:19 Re: regexp on null