Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvDrC-0002Oh-IM for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jun 2021 06:56:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lvDrB-0002rK-9w for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jun 2021 06:56:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvDrB-0002rC-0r for pgsql-hackers@lists.postgresql.org; Mon, 21 Jun 2021 06:56:29 +0000 Received: from mout.gmx.net ([212.227.17.21]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvDr8-0007Do-Ak for pgsql-hackers@lists.postgresql.org; Mon, 21 Jun 2021 06:56:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1624258583; bh=KX5gVvo0fsK3z1KXEZP1P7K5YMqYddbtz9caMATzJXw=; h=X-UI-Sender-Class:To:From:Subject:Date; b=gTcV5byy+0aHFrmtqIDkz1esrgESLExZKfXHWm3BVlF5jCvZKd4hIHJmRjmXcxS+X rustXq6cYPX4es1a6DIAdnat251VH13PZ79CTx6ASJ7FSOVVrbVKXG3C3kfUTRycTL hrupcLgjwyQJq6mZsBPxsQeyJk3+/cmJothklIwE= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.178.42] ([91.64.168.6]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mt757-1l76HH3u01-00tUiO for ; Mon, 21 Jun 2021 08:56:22 +0200 To: pgsql-hackers@lists.postgresql.org From: Brar Piening Subject: Doc patch for Logical Replication Message Formats (PG14) Message-ID: Date: Mon, 21 Jun 2021 08:56:13 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------3E97F32A7A36EADFA2D4A9BF" Content-Language: de-DE X-Provags-ID: V03:K1:SiWGjX6vByGdm39gY0wf+PAqImD5RMZ6wWNpgpszNb5T1cwOHNe sAQP7pqewhl3mKkKuz//wZbE/XUqT7pWkNizqVfOeKD9EhuWbD1zKk/kMBYxTd9PEpt+j+m xvaSAQbkeBO1VWnWfYqyctGcZ5Uhvv8vXScuYI1k1sKQU6PeHaCi9GW1DgtX4mlCbyEaIUG JCQmINL/Pei0F9fbYZ/TQ== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:VYHdfE4O50Q=:OuTwex9ZSJJIJQT9csgaep 2ai1cOguCzLdEx6HyMvEEKlsLQbQ7s6gctLliBchUfFxcN/tPtFJAX9scyGjDvLEU8+FaUKnu S2UOEXGNQfDPB76Y/Q7/73HSewmLhdHBpHnS+6yVMpd79bn78m+3G6f4i5S9z+C4ThGMBsp0R fEL+w5UiubKdAdAik2lz3+2yW4ARVmG+uThQUO5K7ZVVSpXU55+kCMvwd/zbfDBtN/zBtLgz4 AQiYf1edT5jINtyOZPFkxdTikhtIKMTuJ9wfZfL/CsTXes9TrbyPCd+ZiiuW0h+Jxv49v54uf A/CSGk8vt+WfYhBhQnf5lCXipmOJSKsK9nxK3O1+IbYSb6jnDv1RR+7iRrOFke7uVHXAtGM5c sKjO48rR0HhKu4q2eBYAr+N5SRB7rv9/FGiKX1FRELS19rSIPkWCNSy90Fni8x0fxFOZHEv/8 ntuzfYZtKNQEClSt5mGK/kZVw0WcnIX3drJD8MobRWqqUaYWUL6CEvvePI8YNEb2zRDhttH7Z hxdKvjR6OZakKCwY4RqyQcVPulpU2letkGgnYllqsodTcjNX4BzREqwuLFjthxhdNb/yktkhL WuZkUdIF9KBOz3h/dwibIHrfKWj0w3BvBekjoREG5QNF9Q6TWynpMkD+3aI+Xg5I0L7rnTeXS PPoN7YI8a4hZTWbh/n+7YdoNW+OnrnqcTIFwHEKupQy7lq1SJ3UM5OLyxo1RGrmcTSHlD7yG9 KRzw9Uo7uCvGzoS34zJiDt6B5Rv/V2nktCEhh/JK4SMgdwzONqiwr9BzxPAb1cTdWvgxwNOMb S0Oo3My3lrXV9vHCL1UgAFRFyucJu09/anYRM/U58KjiarIPeM1PDdQ3asih7XWeM0YbrF/Gu WEEsIdibdVl875IGImo4fOu/hCDUSuvEnq64y7WWBtCAnCnuHF4sKDnLvQ0+bd6GGn8SeM6vh v7r2FglIVyEfnrTFB0DTH3XfCLbsZjYF9a+o8pPHkhaWUuMB3tLUdqtPC9cJUow6DvY34TTXe 7auUR0ltnNtfVvaeFX4XUWTQLQmQOOwbfgjPn6gJ9NofHYxTpNzj3WLZPAwUSjO7EQBUQY/Pw ksMRBFWuoHxat2NiY7IDuswLZ7S0A72uFrk List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------3E97F32A7A36EADFA2D4A9BF Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable Hello Hackers, while amending Npgsql to account for the Logical Streaming Replication Protocol changes in PostgreSQL 14 I stumbled upon two documentation inaccuracies in the Logical Replication Message Formats documentation (https://www.postgresql.org/docs/devel/protocol-logicalrep-message-formats= .html) that have been introduced (or rather omitted) with the recent changes to allow pgoutput to send logical decoding messages (https://github.com/postgres/postgres/commit/ac4645c0157fc5fcef0af8ff57151= 2aa284a2cec) and to allow logical replication to transfer data in binary format (https://github.com/postgres/postgres/commit/9de77b5453130242654ff0b30a551= c9c862ed661). 1. The content of the logical decoding message in the 'Message' message is prefixed with a length field (Int32) which isn't documented yet. See https://github.com/postgres/postgres/blob/69a58bfe4ab05567a8fab8bdce7f= 3095ed06b99c/src/backend/replication/logical/proto.c#L388 2. The TupleData may now contain the byte 'b' as indicator for binary data which isn't documented yet. See https://github.com/postgres/postgres/blob/69a58bfe4ab05567a8fab8bdce7f= 3095ed06b99c/src/include/replication/logicalproto.h#L83 and https://github.com/postgres/postgres/blob/69a58bfe4ab05567a8fab8bdce7f= 3095ed06b99c/src/backend/replication/logical/proto.c#L558. The attached documentation patch fixes both. Best regards, Brar --------------3E97F32A7A36EADFA2D4A9BF Content-Type: text/plain; charset=UTF-8; name="protocol-logicalrep-message-formats-pg14-fix.patch" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="protocol-logicalrep-message-formats-pg14-fix.patch" ZGlmZiAtLWdpdCBhL2RvYy9zcmMvc2dtbC9wcm90b2NvbC5zZ21sIGIvZG9jL3NyYy9zZ21s L3Byb3RvY29sLnNnbWwNCmluZGV4IGJjMmEyZmViMGIuLjUzYjNmMWY2NTEgMTAwNjQ0DQot LS0gYS9kb2Mvc3JjL3NnbWwvcHJvdG9jb2wuc2dtbA0KKysrIGIvZG9jL3NyYy9zZ21sL3By b3RvY29sLnNnbWwNCkBAIC02NDk4LDYgKzY0OTgsMTggQEAgTWVzc2FnZQ0KIDwvcGFyYT4N CiA8L2xpc3RpdGVtPg0KIDwvdmFybGlzdGVudHJ5Pg0KKw0KKzx2YXJsaXN0ZW50cnk+DQor PHRlcm0+DQorICAgICAgICBJbnQzMg0KKzwvdGVybT4NCis8bGlzdGl0ZW0+DQorPHBhcmE+ DQorICAgICAgICAgICAgICAgIExlbmd0aCBvZiB0aGUgY29udGVudC4NCis8L3BhcmE+DQor PC9saXN0aXRlbT4NCis8L3Zhcmxpc3RlbnRyeT4NCisNCiA8dmFybGlzdGVudHJ5Pg0KIDx0 ZXJtPg0KICAgICAgICAgQnl0ZTxyZXBsYWNlYWJsZT5uPC9yZXBsYWNlYWJsZT4NCkBAIC03 NDMwLDYgKzc0NDIsMTkgQEAgVHVwbGVEYXRhDQogPC9wYXJhPg0KIDwvbGlzdGl0ZW0+DQog PC92YXJsaXN0ZW50cnk+DQorPC92YXJpYWJsZWxpc3Q+DQorICAgICAgICBPcg0KKzx2YXJp YWJsZWxpc3Q+DQorPHZhcmxpc3RlbnRyeT4NCis8dGVybT4NCisgICAgICAgIEJ5dGUxKCdi JykNCis8L3Rlcm0+DQorPGxpc3RpdGVtPg0KKzxwYXJhPg0KKyAgICAgICAgICAgICAgICBJ ZGVudGlmaWVzIHRoZSBkYXRhIGFzIGJpbmFyeSB2YWx1ZS4NCis8L3BhcmE+DQorPC9saXN0 aXRlbT4NCis8L3Zhcmxpc3RlbnRyeT4NCiA8dmFybGlzdGVudHJ5Pg0KIDx0ZXJtPg0KICAg ICAgICAgSW50MzINCg== --------------3E97F32A7A36EADFA2D4A9BF--