473,396 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 4636
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mark Miller | last post by:
I have a scheduled job that uses different XSL templates to transform XML and save it to disk. I am having problems with the code below. The problem shows up on both my development machine (Windows...
7
by: Steve Crawford | last post by:
I am suffering some sort order confusion. Given a database, "foo", with a single character(4) column of data left padded with spaces I get: select * from foo order by somechars; somechars...
21
by: yeti349 | last post by:
Hi, I'm using the following code to retrieve data from an xml file and populate a javascript array. The data is then displayed in html table form. I would like to then be able to sort by each...
4
by: Tim Henderson | last post by:
Hi The question why are there no sorted dictionaries in python, seems to pop up with unseeming regularity. That question in itself in nonsensical sense dictionaries are hash-maps, however should...
2
by: adrian.chandler | last post by:
Hi all, I have been using letter and symbol codes such as GNU< GNU\ GNU} GNUˆ in an Access table. I was surprised to see that when the table was sorted on this field, the order is: GNUˆ...
6
by: Les Juby | last post by:
I need to extract records from a database subject to conditions and only thereafter give the users the choice of which fields to sort the results on. In this situation I can't write back to a...
0
by: Conrad | last post by:
Greetings, For user actions on a wxWidget that trigger multiple events for that wxWidget, is the order those events are processed in undefined, and therefore arbitrary from one platform (ie...
6
by: weetat.yeo | last post by:
Hi all , I have sql statement below , SELECT serial_no,host_name,chasis_model,chasis_flash_size,chasis_dram_size,...
1
by: millw0rm | last post by:
i got 2 array one holds the actual data n another is user generated sort order... how to sort array #1 according to array #2???? array shld be sorted according to sortorder Array #1 ( =Array...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.