Deduplicate logicalrep_read_tuple()

Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>

From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-01-18T07:26:06Z
Lists: pgsql-hackers

Attachments

Hi,

logicalrep_read_tuple() duplicates code for LOGICALREP_COLUMN_TEXT and
LOGICALREP_COLUMN_BINARY introduced by commit 9de77b5. While it
doesn't hurt anyone, deduplication makes code a bit leaner by 57 bytes
[1]. I've attached a patch for $SUBJECT.

Thoughts?

[1] size ./src/backend/replication/logical/proto.o
PATCHED:
   text    data     bss     dec     hex filename
  15558       0       0   15558    3cc6
./src/backend/replication/logical/proto.o

HEAD:
   text    data     bss     dec     hex filename
  15615       0       0   15615    3cff
./src/backend/replication/logical/proto.o

--
Bharath Rupireddy
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Commits

  1. Deduplicate handling of binary and text modes in logicalrep_read_tuple().

  2. Allow logical replication to transfer data in binary format.