Re: US Telephone Number Type - Mailing list pgsql-general

From Merlin Moncure
Subject Re: US Telephone Number Type
Date
Msg-id b42b73150607110818j6fd66dc3l2805bb9ad64501b2@mail.gmail.com
Whole thread Raw
In response to US Telephone Number Type  ("Karen Hill" <karen_hill22@yahoo.com>)
List pgsql-general
On 10 Jul 2006 10:33:52 -0700, Karen Hill <karen_hill22@yahoo.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

pgsql-general by date:

Previous
From: marcelo Cortez
Date:
Subject: Re: encoding bug or feature?
Next
From: "Harald Armin Massa"
Date:
Subject: Re: [pgadmin-support] Emergency - postgre is not working