Re: Sort order with spaces? - Mailing list pgsql-sql

From Kristian Jörg
Subject Re: Sort order with spaces?
Date
Msg-id 3F687BE1.9040105@devo.se
Whole thread Raw
In response to Re: Sort order with spaces?  (Kristian Jörg <krjg@devo.se>)
List pgsql-sql
Tom and Richard,<br /><br /> I have successfully fixed this problem now thanks to your support! The setting of
LC_COLLATEto C prior to running initdb fixed all problems finally once I had sorted out my error in passing the
environmentvariables correctly.<br /><br /> Thanx!<br /> /Kristian<br /><br /> Kristian Jörg wrote:<br /><blockquote
cite="mid3F686F33.7000003@devo.se"type="cite"></blockquote><br /><br /> Tom Lane wrote:<br /><blockquote
cite="mid1935.1063807618@sss.pgh.pa.us"type="cite"><pre wrap="">Kristian Jörg <a class="moz-txt-link-rfc2396E"
href="mailto:krjg@devo.se"><krjg@devo.se></a>writes: </pre><blockquote type="cite"><pre wrap="">Unfortunately
thisdoes 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...   </pre></blockquote><pre wrap="">
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.) </pre></blockquote> Unfortunately I am using a
binarydistribution from a RPM package, so I don't have the source. Tried the strings stuff though and that worked. I
havesv_SE as locale for sure. So you are corect. I did not do initdb correctly. Shame on me... :-)<br /><blockquote
cite="mid1935.1063807618@sss.pgh.pa.us"type="cite"><pre wrap="">Theoretically it should work to doexport
LC_COLLATE=CexportLC_CTYPE=Cinitdb
 
but if you have LANG or other LC_xxx values in your environment,
it's possible that there is some conflict.
        regards, tom lane</pre></blockquote> It is possible my locale settings did not get through to initdb since I
triedusing the startup postgres command in /etc/init.d (with som modifications of course). I will try again manually
thistime!<br /><br /> Regards Kristian<br /><blockquote cite="mid1935.1063807618@sss.pgh.pa.us" type="cite"><pre
wrap="">.
 </pre></blockquote><br /><pre class="moz-signature" cols="72">--           \\|//          (@ @)
+------ooO--(_)--Ooo----------+------------------------------+
| Kristian Jörg               | Phone: +46 54 153395         |
| Devo IT AB                  | Fax:   +46 54 153389         |
| Box 533, SE-651 12 KARLSTAD | <a class="moz-txt-link-freetext"
href="mailto:kristian.jorg@devo.se">mailto:kristian.jorg@devo.se</a>|
 
| Sweden                      | <a class="moz-txt-link-freetext" href="http://www.devo.se">http://www.devo.se</a>
   |
 
+-----------------------------+------------------------------+</pre><br /><pre class="moz-signature" cols="72">--
   \\|//          (@ @)
 
+------ooO--(_)--Ooo----------+------------------------------+
| Kristian Jörg               | Phone: +46 54 153395         |
| Devo IT AB                  | Fax:   +46 54 153389         |
| Box 533, SE-651 12 KARLSTAD | <a class="moz-txt-link-freetext"
href="mailto:kristian.jorg@devo.se">mailto:kristian.jorg@devo.se</a>|
 
| Sweden                      | <a class="moz-txt-link-freetext" href="http://www.devo.se">http://www.devo.se</a>
   |
 
+-----------------------------+------------------------------+</pre>

pgsql-sql by date:

Previous
From: Kristian Jörg
Date:
Subject: Re: Sort order with spaces?
Next
From:
Date:
Subject: Triggers Help...