Re: How to split up phone numbers?

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: How to split up phone numbers?
Date: 2012-02-23 09:14:32
Message-ID: ji501o$6ef$3@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2012-02-20, Andreas <maps(dot)on(at)gmx(dot)net> wrote:
> Hi,
> is there a way to split up phone numbers?

several. I wouldn't trust a computer to do any of them.

> I know that's a tricky topic and it depends on the national phone number
> format.
> I'm especially interested in a solution for Germany, Swizerland and Austria.
>
> I've got everything in a phone number column that makes hardly sense like:
> +49432156780
> 0049 4321 5678 0
> 04321/5678-0
> and so on...
> Those 3 samples are actually the same number in different notations.

normalise them.

push them all towards the first format. the rules are relatively
simple.

now if you want to split that into parts that means something you can
probably get the gorey details from the phone company. but if you
just want do do it for display split it wherever you like.

--
⚂⚃ 100% natural

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message John Fabiani 2012-02-24 08:11:28 crosstab help
Previous Message rverghese 2012-02-22 21:07:20 Re: Concurrent Reindex on Primary Key for large table