Re: Logical Replication and Character encoding

From: Kyotaro HORIGUCHI <horiguchi(dot)kyotaro(at)lab(dot)ntt(dot)co(dot)jp>
To: petr(dot)jelinek(at)2ndquadrant(dot)com
Cc: craig(at)2ndquadrant(dot)com, noriyoshi(dot)shinoda(at)hpe(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Logical Replication and Character encoding
Date: 2017-02-14 02:23:52
Message-ID: 20170214.112352.120935619.horiguchi.kyotaro@lab.ntt.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Sat, 4 Feb 2017 21:27:32 +0100, Petr Jelinek <petr(dot)jelinek(at)2ndquadrant(dot)com> wrote in <bcc7f7e9-f558-b19e-b544-000ba7cf286c(at)2ndquadrant(dot)com>
> Hmm I wonder if we should just make the subscriber send the
> client_encoding always (based on server encoding of the subscriber).
> That should solve the issue in combination with your patch no?

Yeah, right. I considered that a subscriber might want to set its
own value for that but that is useless.

The attached patch does the following things to just prevent
making a logical replication connection between databases with
inconsistent encodings.

- added client_encoding with subscriber(or standby)'s encoding at
the last of options in libpqrcv_connect.

- CheckLogicalDecodingRequirements refuses connection for a
request with inconsistent encodings.

> ERROR: logical replication requires consistent encodings on both side (publisher = UTF8, subscriber = EUC_JP)

We could check this earlier if involving physical replication but
I think this is a matter of logical replication.

regards,

--
Kyotaro Horiguchi
NTT Open Source Software Center

Attachment Content-Type Size
0001-Refuse-logical-replication-with-inconsistent-encodin.patch text/x-patch 2.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andreas Karlsson 2017-02-14 02:32:43 Re: REINDEX CONCURRENTLY 2.0
Previous Message Andres Freund 2017-02-14 02:22:21 Re: PATCH: two slab-like memory allocators