Re: sorting on inet type?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Daniel J(dot) Kressin" <dkressin(at)globalcrossing(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: sorting on inet type?
Date: 2001-03-20 17:56:28
Message-ID: 11625.985110988@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Daniel J. Kressin" <dkressin(at)globalcrossing(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message will trillich 2001-03-20 18:00:54 clever COMMENT/description usage -- internationalizing?
Previous Message Daniel J. Kressin 2001-03-20 17:51:41 Re: sorting on inet type?