order by for strings

Started by Rick Giggerover 22 years ago3 messagesgeneral
Jump to latest
#1Rick Gigger
rgigger@leadership-solutions.net

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

#2Doug McNaught
doug@mcnaught.org
In reply to: Rick Gigger (#1)
Re: order by for strings

"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

#3scott.marlowe
scott.marlowe@ihs.com
In reply to: Rick Gigger (#1)
Re: order by for strings

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.