Re: [SQL] order by different on mac vs linux

2012-05-31 Thread Wes James
On Mon, May 14, 2012 at 5:00 PM, Tom Lane  wrote:

> Wes James  writes:
> > Why is there a different order on the different platforms.
>
> This is not exactly unusual.  You should first check to see if
> lc_collate is set differently in the two installations --- but even if
> it's the same, there are often platform-specific interpretations of
> the sorting rules.  (Not to mention that OS X is flat out broken when
> it comes to sorting UTF8 data ...)
>
> If you want consistent cross-platform results, "C" locale will get
> that for you, but it's pretty stupid about non-ASCII characters.
>
> For more info read
> http://www.postgresql.org/docs/9.1/static/charset.html
>
>regards, tom lane
>

I did pg_dump of data, set LC_ALL=C, did initdb and createdb, pgsql -f
pgdump.sql db, etc, and now it is sorting the way I'd expect and for the
needs I have.

Thanks all for your responses.

-wes


Re: [SQL] order by different on mac vs linux

2012-05-31 Thread Peter Eisentraut
On lör, 2012-05-26 at 21:47 -0600, Wes James wrote:
> on the ascii table here:
> 
> http://www.ascii-code.com/
> 
> upper case letters should sort before lowercase letters.

ASCII has nothing to do with how letters "should" be sorted.  It is not
a sorting standard, it is a character encoding standard.  If you open a
dictionary, you won't (usually) find all upper case letters before all
lower case letters.

The sort orders provided by glibc are, individual bugs aside, correct,
where "correct" means, they implement various national and international
standards.  (Equally, the sort orders on Mac OS X are, degenerate cases
aside, broken, because they don't implement any recognized sorting
standard.)  Of course, you are not required to like them, and there are
many people who have particular issues with them, but you won't get far
claiming they are wrong, if you don't have a recognized alternative
source to point to that defines correctness.



-- 
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql