At Sat, 4 Feb 2017 21:27:32 +0100, Petr Jelinek <petr.jelinek@2ndquadrant.com> wrote in
<bcc7f7e9-f558-b19e-b544-000ba7cf286c@2ndquadrant.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