BUG #6642: Spanish collation fault

From: tulio(dot)carrasco(at)gmail(dot)com
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6642: Spanish collation fault
Date: 2012-05-16 01:45:00
Message-ID: E1SUTIS-0005Yn-61@wrigleys.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 6642
Logged by: T J Carrasco
Email address: tulio(dot)carrasco(at)gmail(dot)com
PostgreSQL version: 9.1.3
Operating system: Ubuntu 12.04 LTS
Description:

In Spanish every vowel has the same precedence value even with or without
any type of accent, so: a = á = ä = A = Á = Ä

With OS locale = lc_collate = lc_ctype = es_ES.UTF-8 then:

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

INSERT INTO test 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'), (8, 'leo','zara', 'juan'), (9,
'león','Valencia', 'jos');

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

We obtain:

id | dad | mum | name
---+------+----------+-------
8 | leo | zara | juan
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
9 | león | Valencia | jos
4 | león | válencia | jos
(9 rows)

Which doesn´t accomplish with Spanish collation. It should be something like
this:

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

In which due dad column has the same value it uses the mum column and if
they also have the same value then it should use the name column.

Thanks in advance for your help.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message katsumata.tomonari 2012-05-16 10:39:36 BUG #6643: [PostgreSQL9.2beta1] COPY after changing fillfactor gets a PANIC.
Previous Message chris 2012-05-15 23:28:39 BUG #6641: uuid.h warning during configure