pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedDifferent encodings and locales on one machine
3+ messages / 3 participants
[nested] [flat]
* Different encodings and locales on one machine
@ 2021-03-04 08:40 mail@localhorst.es
2021-03-04 12:14 ` Re: Different encodings and locales on one machine Holger Jakobs <holger@jakobs.com>
2021-03-04 15:29 ` Re: Different encodings and locales on one machine Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 3+ messages in thread
From: mail@localhorst.es @ 2021-03-04 08:40 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
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
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Different encodings and locales on one machine
2021-03-04 08:40 Different encodings and locales on one machine mail@localhorst.es
@ 2021-03-04 12:14 ` Holger Jakobs <holger@jakobs.com>
1 sibling, 0 replies; 3+ messages in thread
From: Holger Jakobs @ 2021-03-04 12:14 UTC (permalink / raw)
To: pgsql-admin@lists.postgresql.org
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@localhorst.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
Attachments:
OpenPGP_signature (application/pgp-signature, 202B) download
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Different encodings and locales on one machine
2021-03-04 08:40 Different encodings and locales on one machine mail@localhorst.es
@ 2021-03-04 15:29 ` Tom Lane <tgl@sss.pgh.pa.us>
1 sibling, 0 replies; 3+ messages in thread
From: Tom Lane @ 2021-03-04 15:29 UTC (permalink / raw)
To: mail@localhorst.es; +Cc: pgsql-admin@lists.postgresql.org
mail@localhorst.es writes:
> 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.
This statement is nonsensical. The second component of the locale name
is precisely the encoding that the locale is meant to be used with.
There is no such thing as "de_DE.cp1252" locale that works with UTF8
data --- you'd have to use "de_DE.utf8" instead.
You haven't explained exactly why you think you have that requirement,
but I wonder whether you aren't confusing client and server encoding.
There's no problem in having a client that is using WIN1252 encoding
while the server uses UTF8 --- just make sure that the client_encoding
parameter is set correctly for that client.
regards, tom lane
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2021-03-04 15:29 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 08:40 Different encodings and locales on one machine mail@localhorst.es
2021-03-04 12:14 ` Holger Jakobs <holger@jakobs.com>
2021-03-04 15:29 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox