470,874 Members | 1,435 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,874 developers. It's quick & easy.

Sort order is different on Windows and Linux

I have found that the sort order is different on Windows and Linux (same version of Postgres). On Windows, it sorts in what appears to be normal ASCIIorder. On Linux, lowercase comes before uppercase, and all non-alphanumerics appear to come before all alphanumerics. I really need it to sort on Linux the same as it does on Windows. The docs seem to imply that I can simplyset the LANG environment variable to C to get an ASCII sort order, but that seem to make a difference. How do I change the sort order?

Thanks in advance.

Robert

Nov 11 '05 #1
2 4362
On Wed, 17 Sep 2003, Robert Wille wrote:
I have found that the sort order is different on Windows and Linux (same
version of Postgres). On Windows, it sorts in what appears to be normal
ASCII order. On Linux, lowercase comes before uppercase, and all
non-alphanumerics appear to come before all alphanumerics. I really need
it to sort on Linux the same as it does on Windows. The docs seem to
imply that I can simply set the LANG environment variable to C to get an
ASCII sort order, but that seem to make a difference. How do I change
the sort order?


You need to have the database initdb'd with the appropriate collation set
in LC_COLLATE. Changing LANG/LC_COLLATE after the fact won't help (in
recent versions anyway).
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 11 '05 #2
Do I simply "export LC_COLLATE=C" before I initdb, or do I pass it as a
parameter?
On Wed, 17 Sep 2003, Robert Wille wrote:
I have found that the sort order is different on Windows and Linux (same
version of Postgres). On Windows, it sorts in what appears to be normal
ASCII order. On Linux, lowercase comes before uppercase, and all
non-alphanumerics appear to come before all alphanumerics. I really need
it to sort on Linux the same as it does on Windows. The docs seem to
imply that I can simply set the LANG environment variable to C to get an
ASCII sort order, but that seem to make a difference. How do I change
the sort order?


You need to have the database initdb'd with the appropriate collation set
in LC_COLLATE. Changing LANG/LC_COLLATE after the fact won't help (in
recent versions anyway).

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Nov 11 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by Steve Crawford | last post: by
21 posts views Thread by yeti349 | last post: by
4 posts views Thread by Tim Henderson | last post: by
2 posts views Thread by adrian.chandler | last post: by
6 posts views Thread by weetat.yeo | last post: by
1 post views Thread by millw0rm | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.