sorting on inet type? - Mailing list pgsql-general

From Daniel J. Kressin
Subject sorting on inet type?
Date
Msg-id 3AB7907A.8D30911C@globalcrossing.com
Whole thread Raw
Responses Re: sorting on inet type?  (Larry Rosenman <ler@lerctr.org>)
Re: sorting on inet type?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
I have a table with an inet column, which I entered in order initially,
so they came out like:

  1.2.3.4
  1.2.3.5
  1.2.3.40
  1.2.3.41

After updating, say, 1.2.3.5, it moves to the end.  I understand why,
that's not the problem.  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

Is there an easy way to return to the original order, or do I need to
write a custom PL/SQL function to parse the octets and do sorting
manually?  If the latter is the case, help/hints would be appreciated.

Thanks.

P.S. Thanks to the group for all the help you've given on my previous
questions!
--
Dan
 ____    Kressin   ____   .-----------------------------------.
/___ \____________/ __ \  | Unix SysAdmin                     |
    \  \    /      /  \ | | Global Crossing                   |
 ___/ __\/\/rench_ \__/ | | dkressin@globalcrossing.com       |
\____/            \____/  | http://www.vib.org/wrench/        |
                          `-----------------------------------'

pgsql-general by date:

Previous
From: "Brent R. Matzelle"
Date:
Subject: RE: Win Nt setup help please
Next
From: Larry Rosenman
Date:
Subject: Re: sorting on inet type?