On 14/02/17 03:23, Kyotaro HORIGUCHI wrote: > At Sat, 4 Feb 2017 21:27:32 +0100, Petr Jelinek > <petr.jeli...@2ndquadrant.com> wrote in > <bcc7f7e9-f558-b19e-b544-000ba7cf2...@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) >
I am not quite convinced that this should be handled by logical decoding itself. It's quite possible to have output plugins that will handle this correctly for their use-cases (by doing similar conversion you did in the original patch) so they should not be prevented doing so. So it's probably better to check this in the plugin. I do like the idea of just using client_encoding in libpqrcv_connect though. -- Petr Jelinek http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers