Regular Expression Data Type

From: Richard Doust <rdoust(at)mac(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Regular Expression Data Type
Date: 2007-04-21 16:01:19
Message-ID: 5E15083B-418D-4ED6-A0BA-0A55923AD719@mac.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi.
I appreciate that I can query the database and find records that
match a regular expression.
What I'd like to be able to do is to define a field in the database
as a regular expression so that when I select, i.e.,

select price from shipping_prices where shipFromZip = '23773' and
shipToZip ~ '87927'

because shipToZip is defined as a regular expression, I'd match a row
where shipToZip held the value '879[0-9]{2,2}' or '87[0-9]*'.

Wouldn't that be cool? Does anyone know whether this is already
possible?

Thanks.

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2007-04-21 16:01:46 Re: Problem compiling PostgreSQL 8.2.3 on RedHat Enterprise Server 2.1?
Previous Message Michael Glaesemann 2007-04-21 12:49:16 Re: [HACKERS] functions to obtain query plan