Re: Issue on Varchar Ordering
От | Rodrigo Hjort |
---|---|
Тема | Re: Issue on Varchar Ordering |
Дата | |
Msg-id | 731083980603290902s6eacf725x7d28c098ba7754f7@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Issue on Varchar Ordering ("Jonah H. Harris" <jonah.harris@gmail.com>) |
Ответы |
Re: Issue on Varchar Ordering
|
Список | pgsql-hackers |
Yeah, I think there's a problem on Linux locales.
Using the C locale, it works as expected:
rodrigo@asgard:~$ export LC_ALL=C && cat test.txt | sort
GABRIEL ALCIDES KLIM PERONDI
GABRIEL ALEXANDRE DA SILVA MANICA
GABRIELA HELEDA DE SOUZA
GABRIELA JACOBY NOS
GABRIELA LETICIA BATISTA NUNES
But when using Brazilian Portuguese, it gives:
rodrigo@asgard:~$ export LC_ALL=pt_BR && cat test.txt | sort
GABRIELA HELEDA DE SOUZA
GABRIELA JACOBY NOS
GABRIEL ALCIDES KLIM PERONDI
GABRIELA LETICIA BATISTA NUNES
GABRIEL ALEXANDRE DA SILVA MANICA
rodrigo@asgard:~$ export LC_ALL=pt_BR.UTF-8 && cat test.txt | sort
GABRIELA HELEDA DE SOUZA
GABRIELA JACOBY NOS
GABRIEL ALCIDES KLIM PERONDI
GABRIELA LETICIA BATISTA NUNES
GABRIEL ALEXANDRE DA SILVA MANICA
rodrigo@asgard:~$ export LC_ALL=pt_BR.ISO-8859-1 && cat test.txt | sort
GABRIELA HELEDA DE SOUZA
GABRIELA JACOBY NOS
GABRIEL ALCIDES KLIM PERONDI
GABRIELA LETICIA BATISTA NUNES
GABRIEL ALEXANDRE DA SILVA MANICA
The fact is that I can't raise PostgreSQL with C encoding, as special characters are used on most tables.
Did anyone ever had the same problem on Linux?
--
Regards,
Rodrigo Hjort
GTI - Projeto PostgreSQL
CELEPAR - Cia de Informática do Paraná
http://www.pr.gov.br
Using the C locale, it works as expected:
rodrigo@asgard:~$ export LC_ALL=C && cat test.txt | sort
GABRIEL ALCIDES KLIM PERONDI
GABRIEL ALEXANDRE DA SILVA MANICA
GABRIELA HELEDA DE SOUZA
GABRIELA JACOBY NOS
GABRIELA LETICIA BATISTA NUNES
But when using Brazilian Portuguese, it gives:
rodrigo@asgard:~$ export LC_ALL=pt_BR && cat test.txt | sort
GABRIELA HELEDA DE SOUZA
GABRIELA JACOBY NOS
GABRIEL ALCIDES KLIM PERONDI
GABRIELA LETICIA BATISTA NUNES
GABRIEL ALEXANDRE DA SILVA MANICA
rodrigo@asgard:~$ export LC_ALL=pt_BR.UTF-8 && cat test.txt | sort
GABRIELA HELEDA DE SOUZA
GABRIELA JACOBY NOS
GABRIEL ALCIDES KLIM PERONDI
GABRIELA LETICIA BATISTA NUNES
GABRIEL ALEXANDRE DA SILVA MANICA
rodrigo@asgard:~$ export LC_ALL=pt_BR.ISO-8859-1 && cat test.txt | sort
GABRIELA HELEDA DE SOUZA
GABRIELA JACOBY NOS
GABRIEL ALCIDES KLIM PERONDI
GABRIELA LETICIA BATISTA NUNES
GABRIEL ALEXANDRE DA SILVA MANICA
The fact is that I can't raise PostgreSQL with C encoding, as special characters are used on most tables.
Did anyone ever had the same problem on Linux?
2006/3/29, Jonah H. Harris <jonah.harris@gmail.com>:
I don't think PostgreSQL's sorting it wrong... here's the output of
Linux's sort utility:
edb82@linux:~> cat test.txt
GABRIEL ALEXANDRE DA SILVA MANICA
GABRIELA LETICIA BATISTA NUNES
GABRIEL ALCIDES KLIM PERONDI
GABRIELA JACOBY NOS
GABRIELA HELEDA DE SOUZA
edb82@linux:~> cat test.txt | sort
GABRIELA HELEDA DE SOUZA
GABRIELA JACOBY NOS
GABRIEL ALCIDES KLIM PERONDI
GABRIELA LETICIA BATISTA NUNES
GABRIEL ALEXANDRE DA SILVA MANICA
edb82@linux:~> psql -c "SELECT * FROM aluno ORDER BY nome" postgres
id | nome
----+-----------------------------------
36 | GABRIELA HELEDA DE SOUZA
37 | GABRIELA JACOBY NOS
38 | GABRIEL ALCIDES KLIM PERONDI
39 | GABRIELA LETICIA BATISTA NUNES
40 | GABRIEL ALEXANDRE DA SILVA MANICA
(5 rows)
--
Jonah H. Harris, Database Internals Architect
EnterpriseDB Corporation
732.331.1324
--
Regards,
Rodrigo Hjort
GTI - Projeto PostgreSQL
CELEPAR - Cia de Informática do Paraná
http://www.pr.gov.br
В списке pgsql-hackers по дате отправления: