On 1/17/2013 1:12 AM, Sumit Raja wrote:
On 16 January 2013 20:23, Robert James <srobertja...@gmail.com <mailto:srobertja...@gmail.com>> wrote:

    Is there a recommended, high performance method to check for
    subdomains?

    Something like:
    - www.google.com <http://www.google.com> is subdomain of
    google.com <http://google.com>
    - ilikegoogle.com <http://ilikegoogle.com> is not subdomain of
    google.com <http://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.


Reply via email to