Re: Minor documentation error regarding streaming replication protocol

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Minor documentation error regarding streaming replication protocol
Дата
Msg-id 20201014204659.GA19309@momjian.us
обсуждение исходный текст
Ответ на Re: Minor documentation error regarding streaming replication protocol  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: Minor documentation error regarding streaming replication protocol  (Tom Lane <tgl@sss.pgh.pa.us>)
Aw: Re: Minor documentation error regarding streaming replication protocol  (Brar Piening <Brar@gmx.de>)
Список 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@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

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


Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Some remaining htonl() and ntohl() calls in the code
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Minor documentation error regarding streaming replication protocol