Re: Unicode vs SQL_ASCII DBs - Mailing list pgsql-general

From Kris Jurka
Subject Re: Unicode vs SQL_ASCII DBs
Date
Msg-id Pine.LNX.4.33.0402020514070.22628-100000@leary.csoft.net
Whole thread Raw
In response to Re: Unicode vs SQL_ASCII DBs  ("John Sidney-Woollett" <johnsw@wardbrook.com>)
Responses Re: Unicode vs SQL_ASCII DBs  ("John Sidney-Woollett" <johnsw@wardbrook.com>)
Re: Unicode vs SQL_ASCII DBs  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general

On Mon, 2 Feb 2004, John Sidney-Woollett wrote:

> Kris, thanks for you feedback. Can you give me any further info on the
> questions below?
>
> Kris Jurka said:
> >> 3) If I want accented characters to sort correctly, must I select
> >> UNICODE
> >> (or the appropriate ISO 8859 char set) over SQL_ASCII?
> >
> > You are confusing encoding with locale.  Locales determines the correct
> > sort order and you must choose an encoding that works with your locale.
>
> Except that in my test, the two differently encoded databases were in the
> same 7.4.1 cluster with the same locale, yet they sorted the *same* data
> differently - implying the encoding is a factor.

Right, note the "and you must choose an encoding that works with your
locale." clause.  A SQL_ASCII encoding and a UTF-8 locale don't work.

> I basically need "english" sorting, and accented character support without
> any JDBC access/conversion problems. Do you think that my current DB
> locale (en_GB.UTF-8) and UNICODE encoded database the best solution? Or
> can you suggest something better?

If you need "english" sorting like "en_GB" then that is the best option,
but if you just need regular sorting the C locale might be better.  It is
sometimes confusing how en_US (I assume GB is similar) sorts strings with
spaces and punctuation and so on.

Kris Jurka


pgsql-general by date:

Previous
From: "John Sidney-Woollett"
Date:
Subject: Re: Unicode vs SQL_ASCII DBs
Next
From: Alvaro Herrera
Date:
Subject: Re: I can't upgrade to PostgreSQL 7.4 in RedHat 9.0