Re: Sort order confusion

From: Steve Crawford <scrawford(at)pinpointresearch(dot)com>
To: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>, Stephen Robert Norris <srn(at)commsecure(dot)com(dot)au>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sort order confusion
Date: 2004-02-06 01:08:50
Message-ID: 200402051708.50311.scrawford@pinpointresearch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thursday 05 February 2004 5:01 pm, Alvaro Herrera wrote:
> On Fri, Feb 06, 2004 at 11:21:41AM +1100, Stephen Robert Norris
wrote:
> > On Fri, 2004-02-06 at 11:12, Steve Crawford wrote:
> > > I am suffering some sort order confusion. Given a database,
> > > "foo", with a single character(4) column of data left padded
> > > with spaces I get:
> > >
> > > select * from foo order by somechars;
>
> Cast it:
>
> alvherre=> select * from foo order by bar::text::int;
> bar
> ------
> 0
> 1
> 10
> 33
> 100
> 101
> 333
> 503
> (8 filas)

Can't. As noted in the original post the column may contain data that
won't convert to an int (all spaces, characters, punctuation). I'm
seeking generic true ASCII sort order.

Cheers,
Steve

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2004-02-06 01:16:22 Re: Sort order confusion
Previous Message Alvaro Herrera 2004-02-06 01:01:06 Re: Sort order confusion