Re: spanish locale question - Mailing list pgsql-general

From Tulio
Subject Re: spanish locale question
Date
Msg-id 1335998707388-5681819.post@n5.nabble.com
Whole thread Raw
In response to Re: spanish locale question  (jbiskofski <jbiskofski@gmail.com>)
Responses Re: spanish locale question
List pgsql-general
Hi there,

Let me expand the collate situation. I´m from Perú and I have turned
everything in postgresql.conf as 'es_PE.UTF-8' even the
default_text_search_config = 'pg_catalog.spanish'. Even my Ubuntu 12.04
works in English I have es_PE locale too.

In Spanish vowels as "u" is equal as "ú" or even "ü". So let me build an
example:

CREATE TABLE pru(id integer PRIMARY KEY, dad text, mum text, name text);

INSERT INTO pru VALUES (1, 'león','valencia', 'josé'), (2, 'leon',
'mendoza', 'juan'), (3, 'león', 'valárd', 'jose'), (4, 'león','válencia',
'jos'), (5, 'león', 'mendoza', 'jua'), (6, 'leon', 'valencia', 'josie'), (7,
'león', 'valencia', 'josie');

if I do

SELECT * FROM pru order by dad,mum,name;

I get:

 id |  dad |   mum     |  name
----+------+----------+-------
  2 | leon | mendoza  | juan
  6 | leon | valencia   | josie
  5 | león | mendoza  | jua
  3 | león | valárd     | jose
  1 | león | valencia  | josé
  7 | león | valencia  | josie
  4 | león | válencia  | jos
(7 rows)

Which is a wrong order (collation) in Spanish and I don´t understand why.
But, I noticed that if I do:

SELECT * FROM pru order by dad || mum || name;

I get the correct order:

 id |  dad |   mum     |  name
----+------+----------+-------
  5 | león | mendoza  | jua
  2 | leon | mendoza  | juan
  3 | león | valárd     | jose
  4 | león | válencia  | jos
  1 | león | valencia  | josé
  6 | leon | valencia  | josie
  7 | león | valencia  | josie
(7 rows)


Is this the correct way to order in Postgresql and if it´s not Does anyone
have an idea and could please explain it to me?
Thanks in advance.

Tulio


--
View this message in context: http://postgresql.1045698.n5.nabble.com/spanish-locale-question-tp5650043p5681819.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

pgsql-general by date:

Previous
From: leo xu
Date:
Subject: Re: postgresql log indicate too many execute S_2:COMMIT
Next
From: Ben Chobot
Date:
Subject: logging query result size?