Re: US Telephone Number Type

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Karen Hill" <karen_hill22(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: US Telephone Number Type
Date: 2006-07-11 15:18:54
Message-ID: b42b73150607110818j6fd66dc3l2805bb9ad64501b2@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 10 Jul 2006 10:33:52 -0700, Karen Hill <karen_hill22(at)yahoo(dot)com> wrote:
> Hello,
>
> How would one go about creating a US telephone type in the format of
> "(555)-555-5555" ? I am at a loss on how it could be accomplished in
> the most correct way possible while not going into the various
> different country styles e.g. +01 (555) 555-5555.
>
> Is the difficulty of creating a telephone type the reason it is not in
> postgresql already?

if it was me, i would keep a telephone type to simple text field.
while there is some merit to throwing a domain constraint on it,
history tells me this is more troulbe than it's worth :).

otoh, you could make a small immutable sql based regex function to
attempt to extract the area code or some other number from the text
field. You could then index this if desired.

merlin

In response to

Browse pgsql-general by date

  From Date Subject
Next Message lynnsettle@yahoo.com 2006-07-11 15:43:17 Re: customizing pg_dump together with copy.c's DoCopy function
Previous Message Harald Armin Massa 2006-07-11 15:14:48 Re: [pgadmin-support] Emergency - postgre is not working