Re: Looking for types: phone number, email addresses - Mailing list pgsql-general

From Oliver Elphick
Subject Re: Looking for types: phone number, email addresses
Date
Msg-id 1027089637.32686.377.camel@linda
Whole thread Raw
In response to Re: Looking for types: phone number, email addresses  (Stephane Bortzmeyer <bortzmeyer@nic.fr>)
Responses Re: Looking for types: phone number, email addresses
List pgsql-general
On Fri, 2002-07-19 at 15:07, Stephane Bortzmeyer wrote:
> OK, let's check:
>
> CHECK (phone ~ '^\\+[0-9]+[ 0-9]+$')
>
> which is, I believe, international (although the above regexp does not
> prevent strange things like two consecutive spaces).

That would match "+0 ", which is probably not a valid number.  You can
combine several patterns as alternatives in the CHECK constraint or even
put alternatives in the pattern.
--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK
http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "Blessed is the man that trusteth in the LORD, and
      whose hope the LORD is."            Jeremiah 17:7


pgsql-general by date:

Previous
From:
Date:
Subject: Re: References for PostgreSQL
Next
From: Andrew Sullivan
Date:
Subject: Re: Too many clients to Postgresql server