X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id D969CD1B4EF for ; Wed, 17 Sep 2003 15:21:29 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 36691-01 for ; Wed, 17 Sep 2003 12:21:18 -0300 (ADT) Received: from bart.vegasys.net (bart.vegasys.net [213.180.65.17]) by svr1.postgresql.org (Postfix) with ESMTP id 8BC69D1B519 for ; Wed, 17 Sep 2003 12:21:17 -0300 (ADT) Received: from devo.se ([213.180.73.9]) by bart.vegasys.net (8.12.3/8.12.3/Debian-6.3) with ESMTP id h8HFL8XP020791 for ; Wed, 17 Sep 2003 17:21:08 +0200 Received: from devo.se ([213.180.73.9]) by devo.se ([213.180.73.10]) with SMTP (MDaemon.Standard.v6.7.9.R) for ; Wed, 17 Sep 2003 17:21:26 +0100 Message-ID: <3F687BE1.9040105@devo.se> Date: Wed, 17 Sep 2003 17:21:05 +0200 From: =?ISO-8859-1?Q?Kristian_J=F6rg?= Organization: Devo IT AB User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 To: =?ISO-8859-1?Q?Kristian_J=F6rg?= Cc: Tom Lane , Richard Huxton , pgsql-sql@postgresql.org Subject: Re: Sort order with spaces? References: <3F682DB3.6080905@devo.se> <200309171144.02871.dev@archonet.com> <3F6853E4.3000604@devo.se> <1935.1063807618@sss.pgh.pa.us> <3F686F33.7000003@devo.se> In-Reply-To: <3F686F33.7000003@devo.se> Content-Type: multipart/alternative; boundary="------------050509060700000704030400" X-Authenticated-Sender: krjg@devo.se X-MDRemoteIP: 213.180.73.9 X-Return-Path: krjg@devo.se X-MDaemon-Deliver-To: pgsql-sql@postgresql.org X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200309/160 X-Sequence-Number: 15138 This is a multi-part message in MIME format. --------------050509060700000704030400 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Tom and Richard, I have successfully fixed this problem now thanks to your support! The setting of LC_COLLATE to C prior to running initdb fixed all problems finally once I had sorted out my error in passing the environment variables correctly. Thanx! /Kristian Kristian Jörg wrote: > > > Tom Lane wrote: > >>=?ISO-8859-1?Q?Kristian_J=F6rg?= writes: >> >> >>>Unfortunately this does not seem to help! I dumped the database, >>>recreated the cluster with initdb with LC_COLLATE = C (and even tried >>>setting LC_CTYPE to C also), and restored the database. The same >>>ordering appears... >>> >>> >> >>You didn't do it right then ... >> >>7.2's initdb is not helpful about telling you exactly what locale >>settings it's using, but you could use the contrib/pg_controldata >>utility to check what LC_COLLATE and LC_CTYPE settings got used. >>(If you don't want to build pg_controldata, "strings >>$PGDATA/global/pg_control" will do as a rough-and-ready substitute.) >> >> > Unfortunately I am using a binary distribution from a RPM package, so > I don't have the source. Tried the strings stuff though and that > worked. I have sv_SE as locale for sure. So you are corect. I did not > do initdb correctly. Shame on me... :-) > >>Theoretically it should work to do >> export LC_COLLATE=C >> export LC_CTYPE=C >> initdb >>but if you have LANG or other LC_xxx values in your environment, >>it's possible that there is some conflict. >> >> regards, tom lane >> > It is possible my locale settings did not get through to initdb since > I tried using the startup postgres command in /etc/init.d (with som > modifications of course). I will try again manually this time! > > Regards Kristian > >>. >> >> >> > >-- > \\|// > (@ @) >+------ooO--(_)--Ooo----------+------------------------------+ >| Kristian Jörg | Phone: +46 54 153395 | >| Devo IT AB | Fax: +46 54 153389 | >| Box 533, SE-651 12 KARLSTAD | mailto:kristian.jorg@devo.se | >| Sweden | http://www.devo.se | >+-----------------------------+------------------------------+ > -- \\|// (@ @) +------ooO--(_)--Ooo----------+------------------------------+ | Kristian Jörg | Phone: +46 54 153395 | | Devo IT AB | Fax: +46 54 153389 | | Box 533, SE-651 12 KARLSTAD | mailto:kristian.jorg@devo.se | | Sweden | http://www.devo.se | +-----------------------------+------------------------------+ --------------050509060700000704030400 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit Tom and Richard,

I have successfully fixed this problem now thanks to your support! The setting of LC_COLLATE to C prior to running initdb fixed all problems finally once I had sorted out my error in passing the environment variables correctly.

Thanx!
/Kristian

Kristian Jörg wrote:


Tom Lane wrote:
=?ISO-8859-1?Q?Kristian_J=F6rg?= <krjg@devo.se> writes:
  
Unfortunately this does not seem to help! I dumped the database, 
recreated the cluster with initdb with LC_COLLATE = C (and even tried 
setting LC_CTYPE to C also), and restored the database. The same 
ordering appears...
    

You didn't do it right then ...

7.2's initdb is not helpful about telling you exactly what locale
settings it's using, but you could use the contrib/pg_controldata
utility to check what LC_COLLATE and LC_CTYPE settings got used.
(If you don't want to build pg_controldata, "strings
$PGDATA/global/pg_control" will do as a rough-and-ready substitute.)
  
Unfortunately I am using a binary distribution from a RPM package, so I don't have the source. Tried the strings stuff though and that worked. I have sv_SE as locale for sure. So you are corect. I did not do initdb correctly. Shame on me... :-)
Theoretically it should work to do
	export LC_COLLATE=C
	export LC_CTYPE=C
	initdb
but if you have LANG or other LC_xxx values in your environment,
it's possible that there is some conflict.

			regards, tom lane
It is possible my locale settings did not get through to initdb since I tried using the startup postgres command in /etc/init.d (with som modifications of course). I will try again manually this time!

Regards Kristian
.

  

-- 
           \\|//
           (@ @)
+------ooO--(_)--Ooo----------+------------------------------+
| Kristian Jörg               | Phone: +46 54 153395         |
| Devo IT AB                  | Fax:   +46 54 153389         |
| Box 533, SE-651 12 KARLSTAD | mailto:kristian.jorg@devo.se |
| Sweden                      | http://www.devo.se           |
+-----------------------------+------------------------------+

-- 
           \\|//
           (@ @)
+------ooO--(_)--Ooo----------+------------------------------+
| Kristian Jörg               | Phone: +46 54 153395         |
| Devo IT AB                  | Fax:   +46 54 153389         |
| Box 533, SE-651 12 KARLSTAD | mailto:kristian.jorg@devo.se |
| Sweden                      | http://www.devo.se           |
+-----------------------------+------------------------------+
--------------050509060700000704030400--