RE: database encoding and collation.

From: "James Pang (chaolpan)" <chaolpan(at)cisco(dot)com>
To: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: RE: database encoding and collation.
Date: 2022-01-14 02:11:14
Message-ID: PH0PR11MB5191393FFF0FDF0E510CF18CD6549@PH0PR11MB5191.namprd11.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

This question is about how to handle multiple languages in database , English, Japanese ,Chinese... The Oracle database used WE8ISO8859P1 from long time ago , when put "Chinese" letters in database, client application just use WE8ISO8859P1 (client encoding) to insert data into database , so no conversion there. When client app query the data , it still get the data with WE8ISO8859P1 , and then convert that data to UTF8 from client app side. Now, we plan migrate to Postgresql 13, want Postgresql database use WE8ISO8859P1 same as Oracle too, and same handling as Oracle.
Any potential risk ?

Thanks,

James
-----Original Message-----
From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Sent: Friday, January 14, 2022 3:20 AM
To: James Pang (chaolpan) <chaolpan(at)cisco(dot)com>; pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: database encoding and collation.

On Wed, 2022-01-12 at 13:31 +0000, James Pang (chaolpan) wrote:
> We plan to migrate from Oracle to Postgresql 13, existing Oracle
> database charaterset WE8ISO8859P1 , NLS_SORT = BINARY, NLS_COM=BINARY.
> we want to keep same encoding and collation in Postgresql 13 as Oracle, so encoding=LATIN1 (Aliases ISO88591), what’s the suggested collation and ctype? Using ‘C’,’POSIX’, or en_US.LATIN1 ?
> if using en_US.LATIN1 any impact to indexes and query where like % ?
> The OS is Redhat 8, when export NLS_LANG=en_US.LATIN1, LC_COLLATE and
> LC_CTYPE automatically set to en_US.LATIN1, and then initdb create database clusters with  collname, collation, ctype all = en_US.LATIN1.

I advise against using any encoding other than UTF-8.
What are you worried about?

For the locale, you can get the same behavior as in Oracle by using "C" or "POSIX"
(they are the same).

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message James Pang (chaolpan) 2022-01-14 02:14:23 RE: database encoding and collation.
Previous Message Laurenz Albe 2022-01-13 19:19:34 Re: database encoding and collation.