Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 70C359F9FBA for ; Mon, 17 Sep 2007 11:43:39 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 77296-05 for ; Mon, 17 Sep 2007 11:43:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from main2.mycybernet.net (main2.mycybernet.net [209.222.63.140]) by postgresql.org (Postfix) with ESMTP id F34539F9F6A for ; Mon, 17 Sep 2007 11:43:30 -0300 (ADT) Received: from 227-54-222-209.mycybernet.net ([209.222.54.227] helo=crankycanuck.ca) by main2.mycybernet.net with esmtp (Exim 4.62) (envelope-from ) id 1IXHov-0000ew-ME for pgsql-sql@postgresql.org; Mon, 17 Sep 2007 10:43:29 -0400 Received: by crankycanuck.ca (Postfix, from userid 1000) id 932093FAF; Mon, 17 Sep 2007 10:43:24 -0400 (EDT) Date: Mon, 17 Sep 2007 10:43:24 -0400 From: Andrew Sullivan To: pgsql-sql@postgresql.org Subject: Re: Extracting hostname from URI column Message-ID: <20070917144324.GP582@crankycanuck.ca> References: <335491.75226.qm@web54303.mail.re2.yahoo.com> <46E73D1C.4020009@autoledgers.com.au> <46EDB43D.9060405@autoledgers.com.au> <873axekxlr.fsf@oxford.xeocode.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <873axekxlr.fsf@oxford.xeocode.com> User-Agent: Mutt/1.5.9i X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/126 X-Sequence-Number: 29339 On Mon, Sep 17, 2007 at 12:18:56AM +0100, Gregory Stark wrote: > > Not all countries break up their national tld space into sections like .co.uk > or .com.au. Canadian domains can be bought directly under .ca like amazon.ca. > > I think you'll have to store a specific list of tlds and how deep you want to > look. Another way to look at this is that any containing domain is just a domain. So .info is a domain, example.info is a domain, and in case of the existence of host1.some.example.info, some.example.info is a domain. Also, co.uk is just as much a domain as yahoo.co.uk. Some poor misguided people at Netscape badly misunderstood the DNS many years ago, and web browser cookies have been attempting to recover from that misunderstanding ever since (with sometimes serious security implications). There's really no reliable way to deduce common responsibility from the DNS labels, and it's sometimes terrifically important not to make that mistake. A -- Andrew Sullivan | ajs@crankycanuck.ca The plural of anecdote is not data. --Roger Brinner