1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-09 06:21:09 +03:00

Refactor sending of DataRow messages in replication protocol

Some routines open-coded the construction of DataRow messages.  Use
TupOutputState struct and associated functions instead, which was
already done in some places.

SendTimeLineHistory() is a bit more complicated and isn't converted by
this.

Reviewed-by: Nathan Bossart <nathandbossart@gmail.com>
Discussion: https://www.postgresql.org/message-id/flat/7e4fdbdc-699c-4cd0-115d-fb78a957fc22@enterprisedb.com
This commit is contained in:
Peter Eisentraut
2022-07-06 08:28:02 +02:00
parent b55f62abb2
commit 16d52fc89d
2 changed files with 33 additions and 47 deletions

View File

@@ -121,6 +121,17 @@ printsimple(TupleTableSlot *slot, DestReceiver *self)
}
break;
case OIDOID:
{
Oid num = ObjectIdGetDatum(value);
char str[10]; /* 10 digits */
int len;
len = pg_ultoa_n(num, str);
pq_sendcountedtext(&buf, str, len, false);
}
break;
default:
elog(ERROR, "unsupported type OID: %u", attr->atttypid);
}