pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Brar Piening <brar@gmx.de>
To: pgsql-hackers@lists.postgresql.org
Subject: Doc patch for Logical Replication Message Formats (PG14)
Date: Mon, 21 Jun 2021 08:56:13 +0200
Message-ID: <cc70956c-e578-e54f-49e6-b5d68c89576f@gmx.de> (raw)

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/ac4645c0157fc5fcef0af8ff571512aa284a2cec)
and to allow logical replication to transfer data in binary format
(https://github.com/postgres/postgres/commit/9de77b5453130242654ff0b30a551c9c862ed661).


 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/69a58bfe4ab05567a8fab8bdce7f3095ed06b99c/src/backend/repli...
 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/69a58bfe4ab05567a8fab8bdce7f3095ed06b99c/src/include/repli...
    and
    https://github.com/postgres/postgres/blob/69a58bfe4ab05567a8fab8bdce7f3095ed06b99c/src/backend/repli....

The attached documentation patch fixes both.

Best regards,

Brar

Attachments:

protocol-logicalrep-message-formats-pg14-fix.patch (text/plain, 823B) download diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index bc2a2feb0b..53b3f1f651 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -6498,6 +6498,18 @@ Message </para> </listitem> </varlistentry> + +<varlistentry> +<term> + Int32 +</term> +<listitem> +<para> + Length of the content. +</para> +</listitem> +</varlistentry> + <varlistentry> <term> Byte<replaceable>n</replaceable> @@ -7430,6 +7442,19 @@ TupleData </para> </listitem> </varlistentry> +</variablelist> + Or +<variablelist> +<varlistentry> +<term> + Byte1('b') +</term> +<listitem> +<para> + Identifies the data as binary value. +</para> +</listitem> +</varlistentry> <varlistentry> <term> Int32

view thread (6+ messages)  latest in thread

Message-ID: <cc70956c-e578-e54f-49e6-b5d68c89576f@gmx.de>
Permalink:  ../cc70956c-e578-e54f-49e6-b5d68c89576f@gmx.de/
Also on:    postgresql.org/message-id/cc70956c-e578-e54f-49e6-b5d68c89576f@gmx.de

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: brar@gmx.de
  Subject: Re: Doc patch for Logical Replication Message Formats (PG14)
  In-Reply-To: <cc70956c-e578-e54f-49e6-b5d68c89576f@gmx.de>
  References: <cc70956c-e578-e54f-49e6-b5d68c89576f@gmx.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox