Re: Deduplicate logicalrep_read_tuple() - Mailing list pgsql-hackers

From Peter Smith
Subject Re: Deduplicate logicalrep_read_tuple()
Date
Msg-id CAHut+PtbhRdDpL9twoCzcys8TS2R7b3hzTQBB_cU=A62UWvc8w@mail.gmail.com
Whole thread Raw
In response to Deduplicate logicalrep_read_tuple()  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Deduplicate logicalrep_read_tuple()  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
On Wed, Jan 18, 2023 at 6:26 PM Bharath Rupireddy
<bharath.rupireddyforpostgres@gmail.com> wrote:
>
> 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?
>

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



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation
Next
From: Zheng Li
Date:
Subject: Re: Support logical replication of DDLs