Re: Different encodings and locales on one machine

From: Holger Jakobs <holger(at)jakobs(dot)com>
To: pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Different encodings and locales on one machine
Date: 2021-03-04 12:14:03
Message-ID: 0a88d51e-125a-2233-5d78-e9f468bac9a3@jakobs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi Patrick,

I doubt that you need a server set to any locale which isn't UTF8. UTF8
is universal and can handle all characters.

A client can (and does) specify the locale it wants to use for
communication with the server. So it's no problem at all if clients use
cp1252 while the server is capable of storing also characters beyond
this 8-bit-encoding.

Hope this helps.

Regards,

Holger

Am 04.03.21 um 09:40 schrieb mail(at)localhorst(dot)es:
> Hello,
>
> at the moment I am running two different PostgreSQL (12) servers on
> one Ubuntu 20.04 machine.
> For server one I need WIN1252 encoding with "de_DE.cp1252" locales set.
> For server two I need UTF8 encoding, but also with "de_DE.cp1252"
> locales set.
>
> I added support for
> de_DE.CP1252 CP1252
> de_DE.CP1252 UTF-8
> to
> /usr/local/share/i18n/SUPPORTED
> and
> /etc/locale.gen
> and ran
> locale-gen
>
> PostgreSQL seems only to recognize the last entry I added. So I can
> either use "WIN1252" or "UTF-8" encoding with "de_DE.cp1252" locales.
>
> Maybe I just have problems understanding how Liunx is handling
> encodings and locales.
>
> Does anyone is successfully running PostgreSQL with a similar setup as
> I described?
>
> Kind regards,
> Patrick
>
>
--
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2021-03-04 15:29:33 Re: Different encodings and locales on one machine
Previous Message mail 2021-03-04 08:40:26 Different encodings and locales on one machine