After further thinking, I prefer the alternative approach of using pq_sendcountedtext() as is and sticking the trailing zero byte on on the receiving side. This is a more localized change, and keeps the logical replication protocol consistent with the main FE/BE protocol. (Also, we don't need to send a useless byte around.)
Patch attached, and also a test case. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
0001-Fix-logical-replication-between-different-encodings.patch
Description: invalid/octet-stream
0002-Add-test-for-logical-replication-with-different-enco.patch
Description: invalid/octet-stream
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers