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