Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 6BA2E1337B50 for ; Wed, 22 Sep 2010 23:09:01 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 76867-07 for ; Thu, 23 Sep 2010 02:08:50 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from www.postnewspapers.com.au (www.postnewspapers.com.au [202.4.227.11]) by mail.postgresql.org (Postfix) with ESMTP id 2991A1337B4B for ; Wed, 22 Sep 2010 23:08:49 -0300 (ADT) Received: from mail.postnewspapers.com.au (202-89-185-120.static.dsl.amnet.net.au [202.89.185.120]) by www.postnewspapers.com.au (Postfix) with ESMTP id 0370CA28C; Thu, 23 Sep 2010 10:08:46 +0800 (WST) Received: from localhost (localhost [127.0.0.1]) by mail.postnewspapers.com.au (Postfix) with ESMTP id 914BEAE97C; Thu, 23 Sep 2010 10:08:47 +0800 (WST) X-Virus-Scanned: Debian amavisd-new at postnewspapers.com.au Received: from mail.postnewspapers.com.au ([127.0.0.1]) by localhost (mail.postnewspapers.com.au [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cwnPVLvMBG09; Thu, 23 Sep 2010 10:08:42 +0800 (WST) Received: from [10.1.1.5] (124-148-245-78.dyn.iinet.net.au [124.148.245.78]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Craig Ringer", Issuer "POST Certificate Authority" (verified OK)) by mail.postnewspapers.com.au (Postfix) with ESMTPSA id C581FAE9B9; Thu, 23 Sep 2010 10:08:41 +0800 (WST) Message-ID: <4C9AB69F.7080009@postnewspapers.com.au> Date: Thu, 23 Sep 2010 10:08:31 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-GB; rv:1.9.1.12) Gecko/20100914 Thunderbird/3.0.8 MIME-Version: 1.0 To: Andreas CC: pgsql-sql@postgresql.org Subject: Re: HowTo divide streetname from house-nr ? References: <4C9AAC85.1000001@gmx.net> In-Reply-To: <4C9AAC85.1000001@gmx.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/81 X-Sequence-Number: 34612 On 23/09/2010 9:25 AM, Andreas wrote: > Hi, > > how could I divide streetnames from housenumbers ? You can't, reliably. There are papers written on the subject of addressing, address analysis, addressing in databases, etc. How would you handle the address: Person's Name RD3 Clemo Rd Whangarei ? "RD3" is "Rural Delivery Area 3". The posties deliver within the area by named recipient. This is a real address scheme. The world is full of weird and wacky addressing. IMO, unless you're willing to confine your schema to only handling addresses of a particular area you know about, don't try to normalize address. Even then, I wouldn't try to normalize addresses with text processing, I'd ask the user to do it during form entry or not do it at all. If you're trying to find duplicate addresses, matching addreses, etc, then IMO you're better off using existing tools that do this with free-form addresses using national phone databases, postcode databases, etc. -- Craig Ringer Tech-related writing at http://soapyfrogs.blogspot.com/