order by text-type : whitespaces ignored??

Поиск
Список
Период
Сортировка
От peter pilsl
Тема order by text-type : whitespaces ignored??
Дата
Msg-id 457FB733.2070602@goldfisch.at
обсуждение исходный текст
Ответы Re: order by text-type : whitespaces ignored??  (Richard Huxton <dev@archonet.com>)
Список pgsql-general
I just get my mind crossed here:

I do a simple select with order on a text-type. In my opinion entries with
leading spaces should be either first (or maybe last) in the list.
But in my select the whitespace just seems to be ignored:

Note that the second row has a leading space and should imho be first entry.


# select traeger from wb_traeger where id>24 order by traeger;
                  traeger
-----------------------------------------
  GliA - gehirn | lern | impuls | agentur
   Sonstige Träger
  Volkshochschule Floridsdorf
  Zukunftszentrum Tirol
(4 rows)


note that this not only applies to leading spaces:


# select 'x'||traeger from wb_traeger where id>24 order by 'x'||traeger;
                  ?column?
------------------------------------------
  xGliA - gehirn | lern | impuls | agentur
  x Sonstige Träger
  xVolkshochschule Floridsdorf
  xZukunftszentrum Tirol
(4 rows)



the type of my column is simple text:


# \d wb_akademie
                                    Table "public.wb_akademie"
    Column    |            Type             |                     Modifiers

-------------+-----------------------------+----------------------------------------------------
<skip>
  traeger     | text                        |
<skip>



Is there any way to order so that entries with leading spaces are listed first??

thnx,
peter




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

Предыдущее
От: Gergely CZUCZY
Дата:
Сообщение: [girgen@FreeBSD.org: Re: port fault on pg_ctl's place]
Следующее
От: Richard Huxton
Дата:
Сообщение: Re: order by text-type : whitespaces ignored??