Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id C87AEA7D6C for ; Mon, 20 Feb 2012 10:49:56 -0400 (AST) Received: from mailout-de.gmx.net ([213.165.64.22]) by makus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1RzUYt-00055Z-G1 for pgsql-sql@postgresql.org; Mon, 20 Feb 2012 14:49:56 +0000 Received: (qmail invoked by alias); 20 Feb 2012 14:49:41 -0000 Received: from mue-88-130-8-233.dsl.tropolys.de (EHLO [192.168.1.113]) [88.130.8.233] by mail.gmx.net (mp016) with SMTP; 20 Feb 2012 15:49:41 +0100 X-Authenticated: #14269776 X-Provags-ID: V01U2FsdGVkX1+OA+oZ6PKOl9UGhcDBqC+fzQNMN72lugKfFcFdxK S4OXyxs9QCaTJ+ Message-ID: <4F425DB9.3060604@gmx.net> Date: Mon, 20 Feb 2012 15:50:33 +0100 From: Andreas User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: "pgsql-sql@postgresql.org >> PostgresSQL list" Subject: How to split up phone numbers? Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201202/61 X-Sequence-Number: 36354 Hi, is there a way to split up phone numbers? 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. Aim would be to get a normalized number split up in 4 seperate columns nr_nation nr_city nr_main nr_individual so I end up with 49 4321 5678 0 for central 49 4321 5678 42 for Mr. Smith Is this doable? It would be a start to at least split off nr_nation and nr_city.