Re: Sorting in Unicode not working

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Holger Klawitter <lists(at)klawitter(dot)de>
Cc: Postgres Mailing List <pgsql-general(at)postgresql(dot)org>
Subject: Re: Sorting in Unicode not working
Date: 2004-04-10 17:05:14
Message-ID: 7172.1081616714@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Holger Klawitter <lists(at)klawitter(dot)de> writes:
> So in other words, all databases inside postgres must have the same (or at
> least a compatible) encoding+locale

Yup. strcoll()'s locale setting implicitly assumes a particular
encoding (at least on the platforms I'm familiar with), and so selecting
a database encoding that's incompatible with that will give you bizarre
sorting behavior. The apparent freedom to select a per-database
encoding is really illusory in the current PG system, at least if you
have specific ideas about what you want the sort order to be. You
pretty much have to get it right at initdb time.

There was a thread just a day or two back on pgsql-hackers about
generalizing our locale support, which would fix this problem among
others. I'm not sure how soon it will really happen though...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message kirang 2004-04-10 17:47:50 help needed regarding Query processing in postgres
Previous Message Tom Lane 2004-04-10 16:50:48 Re: Sorting in Unicode not working