Re: Best method to compare subdomains - Mailing list pgsql-general

From John R Pierce
Subject Re: Best method to compare subdomains
Date
Msg-id 50F7C2CB.1000500@hogranch.com
Whole thread Raw
In response to Re: Best method to compare subdomains  (Sumit Raja <sumit.raja@raja-consulting.co.uk>)
List pgsql-general
On 1/17/2013 1:12 AM, Sumit Raja wrote:
On 16 January 2013 20:23, Robert James <srobertjames@gmail.com> wrote:
Is there a recommended, high performance method to check for subdomains?

Something like:
- www.google.com is subdomain of google.com
- ilikegoogle.com is not subdomain of google.com
...
Maybe the ltree extension will suit what you are trying to do? http://www.postgresql.org/docs/9.2/static/ltree.html

that would work great, if you reversed the word order ...   so (one of my domains),  www.astronomy.santa-cruz.ca.us. becomes .us.ca.santa-cruz.astronomy.www

I half expected to a see a function that would reverse the order of a ltree's elements, ah well.


pgsql-general by date:

Previous
From: Sumit Raja
Date:
Subject: Re: Best method to compare subdomains
Next
From: Albe Laurenz
Date:
Subject: String comparison and the SQL standard