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

From Lee Kindness
Subject Re: Looking for types: phone number, email addresses
Date
Msg-id 15672.8647.762495.46482@kelvin.csl.co.uk
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  (Stephane Bortzmeyer <bortzmeyer@nic.fr>)
List pgsql-general
Stephane Bortzmeyer writes:
 >  Oliver Elphick <olly@lfix.co.uk> wrote
 > > CHECK (phone ~ '^\\+33 [0-9]( [0-9]{2}){4}$')
 > > That's only good for French numbers
 > 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).

Still a loosing battle and IMO a needless constraint... For example
I'd normally write my work number as '+44 (0)131 557 5595' which the
above regex wouldn't grok... And it's also common in several counties
for people to use '.' and '-' as separators!

Is the field going to be used by humans (in which case they can sort
out minor formatting issues on the fly) or for automated dialing
(in which case you'd probably want to strip out everything bar
numerics)?

Lee.

pgsql-general by date:

Previous
From: Stephane Bortzmeyer
Date:
Subject: Re: Looking for types: phone number, email addresses
Next
From:
Date:
Subject: Re: References for PostgreSQL