Re: phone number list - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: phone number list
Date
Msg-id 20030910202810.GB30774@wolff.to
Whole thread Raw
In response to Re: phone number list  (Bryan Irvine <bryan.irvine@kingcountyjournal.com>)
List pgsql-novice
On Wed, Sep 10, 2003 at 12:31:04 -0700,
  Bryan Irvine <bryan.irvine@kingcountyjournal.com> wrote:
>
> I dropped the db and recreated the fields using varchar as Louise
> suggested.  Here are the commands I'm using to create the tables:
>
>  create table phonenumbers (
>              areacode varchar(3),
>              prefix varchar(3),
>              suffix varchar(4)
>              );

I don't think you want to do it that way. If you are just handling
North American numbers without extensions then the area code is
exactly 3 digits, not up to 3 digits. The same applies for what you
call the prefix and suffix.

If you are handling international numbers than you don't want to limit
the number of digits in each section because different countries do
different things (some don't have area or city codes). You will also
need have a location for the country code. (For NA the country code
is '1'.)

pgsql-novice by date:

Previous
From: Bryan Irvine
Date:
Subject: Re: phone number list
Next
From: "Louise Cofield"
Date:
Subject: Macro substitution in Postgres