Received: from sss2.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.10.1/8.10.1) with ESMTP id e8B1onf08631; Sun, 10 Sep 2000 21:50:49 -0400 (EDT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss2.sss.pgh.pa.us (8.9.3/8.9.3) with ESMTP id VAA09115; Sun, 10 Sep 2000 21:50:41 -0400 (EDT) To: Max Pyziur cc: pgsql-admin@postgresql.org, pgsql-sql@postgresql.org, pgsql-bugs@hub.org Subject: Re: [BUGS] "ORDER BY" issue - is this a bug? In-reply-to: <39BC3003.FC5A3449@panix.com> References: <39BBD09C.C8F6B3F8@panix.com> <5410.968632518@sss.pgh.pa.us> <39BC3003.FC5A3449@panix.com> Comments: In-reply-to Max Pyziur message dated "Sun, 10 Sep 2000 21:06:11 -0400" Date: Sun, 10 Sep 2000 21:50:41 -0400 Message-ID: <9111.968637041@sss.pgh.pa.us> From: Tom Lane X-Archive-Number: 200009/17 Max Pyziur writes: >> That's pretty bizarre (not to say difficult to believe). What LOCALE >> setting are you running the postmaster in? > On none of the installations - the two 6.5.x and the 7.0.2-2 one - I > don't have any locale set. I get (what I think are) correct results > with the first two. > Does 7.0.2-2 require the setting of locale. AFAIK its behavior should be the same as 6.5 for LOCALE issues. That's why I suspect an environment difference. I can assure you there is no code in the backend that will do case-insensitive, punctuation-insensitive comparisons --- much less any to do so without request. I'm betting that either this is your error, or the strcmp() library function is doing it; and as far as I've heard, only LOCALE environment variables might affect the behavior of strcmp(). It also seems possible that no sort is happening at all (which would be a planner bug), and the ordering you're getting is just whatever happens to be in the underlying table. Does EXPLAIN show that the query is being done with an explicit sort? regards, tom lane