Re: spanish locale question

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Al Eridani <al(dot)eridani(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: spanish locale question
Date: 2012-05-04 17:31:51
Message-ID: 8396.1336152711@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Al Eridani <al(dot)eridani(at)gmail(dot)com> writes:
> What Tulio is saying is that 'leon' and 'len' are the same thing from
> the point of view of sorting in Spanish, but his PostgreSQL seems to
> think that 'leon' goes before 'len'.

Postgres never considers that two distinct strings are "equal". If the
locale setting considers these equal (which isn't entirely clear from
the given evidence), PG would then sort them on the basis of their
character code values.

A possible workaround if you need to consider them equal is to strip the
accents before sorting (ie, something like "ORDER BY to_ascii(col)") but
this may well throw away more information than you want ...

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ben Chobot 2012-05-04 17:35:57 Re: .pgpass not working
Previous Message leaf_yxj 2012-05-04 17:23:14 How to know there is any ODBC Driver installed in the Linux redhat 5.7 server? Thanks