Skip site navigation (1) Skip section navigation (2)

Re: problem with sorting using 'ORDER BY' when character field is filled with numerical values

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dragan Matic <mlists(at)panforma(dot)co(dot)yu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: problem with sorting using 'ORDER BY' when character field is filled with numerical values
Date: 2004-05-20 16:10:38
Message-ID: 1790.1085069438@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-general
Dragan Matic <mlists(at)panforma(dot)co(dot)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

In response to

pgsql-general by date

Next:From: Joe ConwayDate: 2004-05-20 16:11:58
Subject: Re: Dblink question
Previous:From: Stephan SzaboDate: 2004-05-20 16:08:48
Subject: Re: problem with sorting using 'ORDER BY' when character

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group