Subject: Deduplicate logicalrep_read_tuple()

From: Bharath Rupireddy <[email-masked]>
Date: Wed, 18 Jan 2023 12:56:06 +0530

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

---

From: Peter Smith <[email-masked]>
Date: Thu, 19 Jan 2023 14:06:26 +1100

> [1]. I've attached a patch for $SUBJECT.

The code looks the same but there is a subtle comment difference where
previously only LOGICALREP_COLUMN_BINARY case said:
 /* not strictly necessary but per StringInfo practice */

So if you de-duplicate the code then should that comment be modified to say
/* not strictly necessary for LOGICALREP_COLUMN_BINARY but per
StringInfo practice */

------
Kind Regards,
Peter Smith.
Fujitsu Australia