Search Postgresql Archives

Re: regexp on null

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ya, I kinda knew about these approaches.  The problem ahs to do with novice users who don't know about coalesce or or;ing a check ofr nulls.  I was hoping there was some special regexp expression that would match to a null.

Thanks for the quick response, and have a great weekend !

-----Original Message-----
From: Richard Broersma [mailto:richard.broersma@xxxxxxxxx] 
Sent: Friday, September 10, 2010 12:19 PM
To: Gauthier, Dave
Cc: pgsql-general@xxxxxxxxxxxxxx
Subject: Re:  regexp on null

On Fri, Sep 10, 2010 at 9:00 AM, Gauthier, Dave <dave.gauthier@xxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux