Re: Problem with Create Domain example - Mailing list pgsql-patches

From Robert Treat
Subject Re: Problem with Create Domain example
Date
Msg-id 200504302208.32599.xzilla@users.sourceforge.net
Whole thread Raw
In response to Re: Problem with Create Domain example  (Alvaro Herrera <alvherre@dcc.uchile.cl>)
Responses Re: Problem with Create Domain example
List pgsql-patches
On Saturday 30 April 2005 21:14, Alvaro Herrera wrote:
> On Sat, Apr 30, 2005 at 06:12:27PM -0400, Robert Treat wrote:
> > --- 167,174 ----
> >   <programlisting>
> >   CREATE DOMAIN us_postal_code AS TEXT
> >   CHECK(
> > !    VALUE ~ '^\\d{5}$'
> > ! OR VALUE ~ '^\\d{5}-\\d{4}$'
> >   );
>
> Huh, why not
>
> VALUE ~ '^\\d{5}(-\\d{4})?$'
>
> ?

Not sure what your driving at here... my point is that the \ escaping is
incorrect in the current examples.

If you want to argue that we could make the check constraint simpler (or is
that more advanced) that seems like another issue.  IMHO having the OR'd
checks is better because it shows that you can "stack" constraints inside a
domain if you want.

--
Robert Treat
Build A Brighter Lamp :: Linux Apache {middleware} PostgreSQL

pgsql-patches by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Problem with Create Domain example
Next
From: David Fetter
Date:
Subject: Re: Problem with Create Domain example