Re: Sorting in Unicode not working - Mailing list pgsql-general

From Tom Lane
Subject Re: Sorting in Unicode not working
Date
Msg-id 7172.1081616714@sss.pgh.pa.us
Whole thread Raw
In response to Re: Sorting in Unicode not working  (Holger Klawitter <lists@klawitter.de>)
List pgsql-general
Holger Klawitter <lists@klawitter.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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Sorting in Unicode not working
Next
From: kirang@it.iitb.ac.in
Date:
Subject: help needed regarding Query processing in postgres