Re: Sort order with spaces?

Поиск
Список
Период
Сортировка
От Kristian Jörg
Тема Re: Sort order with spaces?
Дата
Msg-id 3F6853E4.3000604@devo.se
обсуждение исходный текст
Ответ на Re: Sort order with spaces?  (Richard Huxton <dev@archonet.com>)
Ответы Re: Sort order with spaces?
Re: Sort order with spaces?
Список pgsql-sql
<br /><br /> Richard Huxton wrote:<br /><blockquote cite="mid200309171144.02871.dev@archonet.com" type="cite"><pre
wrap="">OnWednesday 17 September 2003 10:47, Kristian Jörg wrote: </pre><blockquote type="cite"><pre wrap="">Hello!
 

I am having troubles with sort order in Postgres. It seems that space is
not handled at all?
For instance the following rows are sorted in MS SQL Server as:

LUNDGREN
M L R
MACDOWELL
MUSCLE

But in Postgres I get this order:

LUNDGREN
MACDOWELL
M L R
MUSCLE   </pre></blockquote><pre wrap="">
Sort order depends upon your locale settings (specifically LC_COLLATE), which 
will have been set when you ran "initdb". Basically, sort orders for C , 
en_GB and fr will all be different. I'm guessing you expect "C" style 
sorting.

Check the end of your postgresql.conf file to see what settings you currently 
have.
See the manuals (Localization section) and list archives for plenty of 
details. </pre></blockquote><br /> Hi Richard!<br /><br /> 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
restoredthe database. The same ordering appears...<br /> I did look through all the manuals and I noted that the method
forsetting locale is different for 7.2 and 7.3, so I followed the 7.2 docs. My postgres version is 7.2. <br /><br />
Thetable keeps the data above in a column named "NORMTEXT" and my SQL statement for the result above is:<br /> select *
frommytable where NORMTEXT >=  'LU'<br /> Nothing out of the ordinary there..<br /> Any help on this matter is
highlyappreciated! <br /><br /> Regards<br /> Kristian<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 по дате отправления:

Предыдущее
От: Christoph Haller
Дата:
Сообщение: Re: sub query
Следующее
От: Kristian Jörg
Дата:
Сообщение: Re: Sort order with spaces?