Re: sorting on inet type? - Mailing list pgsql-general

From Tom Lane
Subject Re: sorting on inet type?
Date
Msg-id 11625.985110988@sss.pgh.pa.us
Whole thread Raw
In response to sorting on inet type?  ("Daniel J. Kressin" <dkressin@globalcrossing.com>)
List pgsql-general
"Daniel J. Kressin" <dkressin@globalcrossing.com> writes:
> Adding an 'ORDER BY host(ip)' clause causes the
> ordering to be:

>   1.2.3.4
>   1.2.3.40
>   1.2.3.41
>   1.2.3.5

host(ip) produces a text result, so the above sort is according to
string-comparison rules.  If you want a numeric sort why don't
you just "ORDER BY ip"?

            regards, tom lane

pgsql-general by date:

Previous
From: "Daniel J. Kressin"
Date:
Subject: Re: sorting on inet type?
Next
From: Tom Lane
Date:
Subject: Re: sorting on inet type?