Skip to content

Commit d7fa90f

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 7f69ed4 commit d7fa90f

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
@@ -1858,7 +1858,10 @@ The commands accepted in replication mode are:
18581858
<para>
18591859
Requests the server to send over the timeline history file for timeline
18601860
<replaceable class="parameter">tli</replaceable>. Server replies with a
1861-
result set of a single row, containing two fields:
1861+
result set of a single row, containing two fields. While the
1862+
fields are labeled as <type>text</type> and <type>bytea</type>,
1863+
they effectively return raw bytes, with no escaping or encoding
1864+
conversion:
18621865
</para>
18631866

18641867
<para>

src/backend/replication/walsender.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,10 @@ SendTimeLineHistory(TimeLineHistoryCmd *cmd)
466466
pq_sendstring(&buf, "content"); /* col name */
467467
pq_sendint32(&buf, 0); /* table oid */
468468
pq_sendint16(&buf, 0); /* attnum */
469+
/*
470+
* While this is labeled as BYTEAOID, it is the same output format
471+
* as TEXTOID above.
472+
*/
469473
pq_sendint32(&buf, BYTEAOID); /* type oid */
470474
pq_sendint16(&buf, -1); /* typlen */
471475
pq_sendint32(&buf, 0); /* typmod */

0 commit comments

Comments
 (0)