Re: US Telephone Number Type

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
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-10 18:07:58
Message-ID: 20060710180758.GF17723@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-07-10 18:15:45 Re: Aim of --enable-thread-safety ?
Previous Message marcelo Cortez 2006-07-10 17:44:20 encoding bug or feature?