Skip site navigation (1) Skip section navigation (2)

Re: BUG #6642: Spanish collation fault

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: tulio(dot)carrasco <tulio(dot)carrasco(at)gmail(dot)com>
Cc: Pg Bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #6642: Spanish collation fault
Date: 2012-05-16 19:20:44
Message-ID: 1337195790-sup-2177@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-bugs
Excerpts from tulio.carrasco's message of mar may 15 21:45:00 -0400 2012:

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

> 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.

I see your point, and it makes sense, but it just doesn't work that way.

The way it works is that it goes over the first column and does the two
passes (first ignoring accents, second considering them) over it using
the collating rules you describe; and once that is complete, it goes to
look at the second column.  I don't think it's possible at all to
implement what you suggest, which is to make the first pass over all the
columns and then the second pass over all the columns.

I didn't try, but if you were to do an ORDER BY dad || ' ' || mum ' ' || name
I think it should do what you want.  (Not really sure the spaces are
necessary).  Because then you're sorting on a single string and it can
do the first pass on the whole thing and then the second pass.

-- 
Álvaro Herrera <alvherre(at)commandprompt(dot)com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2012-05-17 00:04:18
Subject: Re: BUG #6644: Query give wrong results when 'is not null' is applied in where clause
Previous:From: steveDate: 2012-05-16 18:49:46
Subject: BUG #6646: PL/Python spiexceptions raised inside Python do notinclude sqlstate in external code

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group