Re: problem with sorting using 'ORDER BY' when character field is filled with numerical values - Mailing list pgsql-general

From Tom Lane
Subject Re: problem with sorting using 'ORDER BY' when character field is filled with numerical values
Date
Msg-id 1790.1085069438@sss.pgh.pa.us
Whole thread Raw
In response to problem with sorting using 'ORDER BY' when character field is filled with numerical values  (Dragan Matic <mlists@panforma.co.yu>)
List pgsql-general
Dragan Matic <mlists@panforma.co.yu> writes:
> Is there some way to make Postgres sort elements
> in this way (setting sort order or collation, I suppose)?

C locale would sort that way; you appear to be using some other locale.

I concur with the nearby suggestions that you should consider a more
appropriate datatype, if all your data will be integers.  Operations on
integers will be lots faster than operations on strings.

            regards, tom lane

pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: problem with sorting using 'ORDER BY' when character
Next
From: Joe Conway
Date:
Subject: Re: Dblink question