Skip to content

Commit 86913ba

Browse files
committed
doc: wire protocol data type for history file content is bytea
Document that though the history file content is marked as bytea, it is the same a text, and neither is btyea-escaped or encoding converted. Reported-by: Brar Piening Discussion: https://postgr.es/m/6a1b9cd9-17e3-df67-be55-86102af6bdf5@gmx.de Backpatch-through: 13 - 9.5 (not master)
1 parent 245a35f commit 86913ba

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

doc/src/sgml/protocol.sgml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1425,7 +1425,10 @@ The commands accepted in walsender mode are:
14251425
<para>
14261426
Requests the server to send over the timeline history file for timeline
14271427
<replaceable class="parameter">tli</replaceable>. Server replies with a
1428-
result set of a single row, containing two fields:
1428+
result set of a single row, containing two fields. While the
1429+
fields are labeled as <type>text</type> and <type>bytea</type>,
1430+
they effectively return raw bytes, with no escaping or encoding
1431+
conversion:
14291432
</para>
14301433

14311434
<para>

src/backend/replication/walsender.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd)
462462
pq_sendstring(&buf, "content"); /* col name */
463463
pq_sendint(&buf, 0, 4); /* table oid */
464464
pq_sendint(&buf, 0, 2); /* attnum */
465+
/*
466+
* While this is labeled as BYTEAOID, it is the same output format
467+
* as TEXTOID above.
468+
*/
465469
pq_sendint(&buf, BYTEAOID, 4); /* type oid */
466470
pq_sendint(&buf, -1, 2); /* typlen */
467471
pq_sendint(&buf, 0, 4); /* typmod */

0 commit comments

Comments
 (0)