Thread: order by for strings
I have two postgres 7.2 servers. One is running 7.2.3 and one is running 7.2.4. I am querying for a word list and doing an order by on the word field. On the 7.2.3 server it is ordering like this: a A b B c C which is what I want. But on the 7.2.4 server it is doing it like this: A B C a b c Is this a change from 7.2.3 to 7.2.4 or a configure or compile option that I set differently on the two systems? Thanks, rg
"Rick Gigger" <rgigger@leadership-solutions.net> writes: > Is this a change from 7.2.3 to 7.2.4 or a configure or compile option that I > set differently on the two systems? Sort order depends on your locale settings. They are probably different on the two machines. -Doug
On Thu, 11 Dec 2003, Rick Gigger wrote: > I have two postgres 7.2 servers. One is running 7.2.3 and one is running > 7.2.4. I am querying for a word list and doing an order by on the word > field. > > On the 7.2.3 server it is ordering like this: > > a > A > b > B > c > C > > which is what I want. But on the 7.2.4 server it is doing it like this: > > A > B > C > a > b > c > > Is this a change from 7.2.3 to 7.2.4 or a configure or compile option that I > set differently on the two systems? It's an initdb time option, meaning you'll need to pg_dump(all) the database, clear out the $PGDATA directory, then run initdb --locale=XXX where XXX is the appropriate locale.