Re: Deduplicate logicalrep_read_tuple()

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Deduplicate logicalrep_read_tuple()
Date: 2023-01-19 03:06:26
Message-ID: CAHut+PtbhRdDpL9twoCzcys8TS2R7b3hzTQBB_cU=A62UWvc8w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 18, 2023 at 6:26 PM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zheng Li 2023-01-19 03:09:02 Re: Support logical replication of DDLs
Previous Message Andres Freund 2023-01-19 03:04:48 Re: Decoupling antiwraparound autovacuum from special rules around auto cancellation