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

From Martijn van Oosterhout
Subject Re: US Telephone Number Type
Date
Msg-id 20060710180758.GF17723@svana.org
Whole thread Raw
In response to US Telephone Number Type  ("Karen Hill" <karen_hill22@yahoo.com>)
Responses Re: US Telephone Number Type  (Steve Atkins <steve@blighty.com>)
Re: US Telephone Number Type  (SCassidy@overlandstorage.com)
List pgsql-general
On Mon, Jul 10, 2006 at 10:33:52AM -0700, Karen Hill 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.

How do you mean "styles". The above number is, when printed in standard
international format +15555555555. The number needed to dial
international is not relevent. What makes it tricky is that people
don't agree on how numbers should be formatted.

> Is the difficulty of creating a telephone type the reason it is not in
> postgresql already?

It wouldn't be hard, it's just not clear what the advantage is over
just having a string and some functions to display the number.

> Should the telephone type be able to do something such as:
>
> SELECT * from tableFOO where telephone.areacode = 555;

Maybe, but is that useful? Maybe America is different, but my
experience in NL and AU is that you rarely care about the areacode
anyway, so why would you want to pull it out?

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Attachment

pgsql-general by date:

Previous
From: Jorge Godoy
Date:
Subject: Re: encoding bug or feature?
Next
From: Vivek Khera
Date:
Subject: Re: US Telephone Number Type