Re: Minor documentation error regarding streaming replication protocol

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Brar Piening <brar(at)gmx(dot)de>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Minor documentation error regarding streaming replication protocol
Date: 2020-10-14 20:46:59
Message-ID: 20201014204659.GA19309@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Oct 8, 2020 at 11:17:59PM -0400, Bruce Momjian wrote:
> Good point. The reporter was assuming the data would come to the client
> in the bytea output format specified by the GUC, e.g. \x..., so that
> doesn't happen either. As I said before, it is more raw bytes, but we
> don't have an SQL data type for that.

I did some more research on this. It turns out timeline 'content' is
the only BYTEA listed in the protocol docs, even though it just passes C
strings to pq_sendbytes(), just like many other fields like the field
above it, the timeline history filename. The proper fix is to change
the code to return the timeline history file contents as TEXT instead of
BYTEA.

Patch attached. I would like to backpatch this to all supported
versions so we are consistent and people don't think different PG
versions use different return values for this. Is that safe? Looking
at the uses of this in our code, it seems so. We aren't doing BYTEA
escaping or TEXT encoding conversion in any of these cases.

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EnterpriseDB https://enterprisedb.com

The usefulness of a cup is in its emptiness, Bruce Lee

Attachment Content-Type Size
timeline.diff text/x-diff 1.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2020-10-14 21:10:30 Re: Minor documentation error regarding streaming replication protocol
Previous Message Andres Freund 2020-10-14 20:46:13 Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.