The following bug has been logged online:
Bug reference: 1183
Logged by: Everton Luis Berz
Email address: everton@faccat.br
PostgreSQL version: 7.4
Operating system: Linux Slackware 9.1
Description: order by ignoring whitespaces on collate pt_BR
Details:
The order by is ignoring whitespaces.
Follow example:
# select codigo, nome from usa_nalu where nome ilike 'maria%' ORDER BY
NOME;
(...)
codigo | nome
----------+-------------------------------
003414 | MARIA NILDA DA SILVA E SILVA
1040534 | MARIA NILZA GOMES GRASSMANN
503/0028 | MARIAN MINEGAS
10305081 | MARIANO ANDRE ANDERSON
871104 | MARIANO DE CASTILHOS PETERSEN
001726 | MARIA NOELI ZIMMER CLEMENT
931129 | MARIA ODETE DA SILVA APOLLO
002351 | MARIA ONEIDE DO AMARAL
(...)
MARIA-MARIAN-MARIANO-MARIA again?
My configuration is:
# select name, setting from pg_settings where name in
('client_encoding', 'server_encoding', 'lc_collate');
name | setting
-----------------+---------
client_encoding | LATIN1
lc_collate | pt_BR
server_encoding | LATIN1