Re: Looking for types: phone number, email addresses

From: Stephane Bortzmeyer <bortzmeyer(at)nic(dot)fr>
To: Lee Kindness <lkindness(at)csl(dot)co(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Looking for types: phone number, email addresses
Date: 2002-07-19 14:38:56
Message-ID: 20020719143856.GA23953@nic.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Jul 19, 2002 at 03:27:19PM +0100,
Lee Kindness <lkindness(at)csl(dot)co(dot)uk> wrote
a message of 20 lines which said:

> 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)?

Mostly by humans (I don't foresee automatic use) but the idea was to
catch mispellings (such as typing O "o" instead of 0 "zero").

Email addresses, on the other hand, *will* be used automatically
(opt-in only, do not worry).

At the present time, I use:

-- Not perfectly RFC 2822-compliant :-(
email TEXT NOT NULL CHECK (email ~ '^[a-zA-Z0-9\+\(dot)\_\-]+(at)[a-zA-Z0-9\(dot)\-]+$'),
phone TEXT CHECK (phone ~ '^\\+[0-9]+[ 0-9]+$'),
fax TEXT CHECK (fax ~ '^\\+[0-9]+[ 0-9]+$'),

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Elphick 2002-07-19 14:40:36 Re: Looking for types: phone number, email addresses
Previous Message Andrew Sullivan 2002-07-19 14:34:50 Re: Too many clients to Postgresql server