Sort order confusion

Поиск
Список
Период
Сортировка
От Steve Crawford
Тема Sort order confusion
Дата
Msg-id 200402051612.43686.scrawford@pinpointresearch.com
обсуждение исходный текст
Ответы Re: Sort order confusion  (Stephen Robert Norris <srn@commsecure.com.au>)
Re: Sort order confusion  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
Список pgsql-general
I am suffering some sort order confusion. Given a database, "foo",
with a single character(4) column of data left padded with spaces I
get:

select * from foo order by somechars;

somechars
-----------
    0
    1
   10
  100
 1011
  111
 1512
    2
  222
    3
  333

The output I desire is a basic ASCII sort:

somechars
-----------
    0
    1
    2
    3
   10
  100
  111
  222
  333
 1011
 1512

(This sample set just has spaces and numeric digits but could have
other characters - I want the output in ASCII sort order)

1. What is the correct way to do this?

2. How do I verify the locale setting of an existing database cluster
(to verify that I really initialized it as "initdb -d --locale=C -D
/var/lib/pgsql/data")?

3. Should I have included "--enable-locale" or similar option when I
built Postgresql (the build is vanilla 7.4.1 "./configure ; make ;
make install")?

Cheers,
Steve


В списке pgsql-general по дате отправления:

Предыдущее
От: Lamar Owen
Дата:
Сообщение: Re: PostgreSQL 7.4.1 and pgdb.py
Следующее
От: Stephen Robert Norris
Дата:
Сообщение: Re: Sort order confusion