RE: Data is copied twice when specifying both child and parent table in publication - Mailing list pgsql-hackers

From osumi.takamichi@fujitsu.com
Subject RE: Data is copied twice when specifying both child and parent table in publication
Date
Msg-id TYCPR01MB8373AE12CC04AEF4593BF347EDCA9@TYCPR01MB8373.jpnprd01.prod.outlook.com
Whole thread Raw
In response to RE: Data is copied twice when specifying both child and parent table in publication  ("wangw.fnst@fujitsu.com" <wangw.fnst@fujitsu.com>)
Responses RE: Data is copied twice when specifying both child and parent table in publication
List pgsql-hackers
On Friday, May 13, 2022 6:42 PM Wang, Wei/王 威 <wangw.fnst@fujitsu.com> wrote:
> Attach the patches.(Only changed the patch for HEAD.).
> 1. Optimize the code. Reduce calls to function filter_partitions. [suggestions by
> Amit-san] 2. Improve the alias name in SQL. [suggestions by Amit-san] 3.
> Improve coding alignments. [suggestions by Amit-san] 4. Do some
> optimizations for list Concatenate.
Hi, thank you for updating the patch.


I have one minor comment on fetch_table_list() in HEAD v4.


@@ -1759,17 +1759,22 @@ static List *
 fetch_table_list(WalReceiverConn *wrconn, List *publications)
 {
        WalRcvExecResult *res;
-       StringInfoData cmd;
+       StringInfoData cmd,
+                               pub_names;
        TupleTableSlot *slot;
        Oid                     tableRow[2] = {TEXTOID, TEXTOID};
        List       *tablelist = NIL;

+       initStringInfo(&pub_names);
+       get_publications_str(publications, &pub_names, true);
+

Kindly free the pub_names's data along with the cmd.data.


Best Regards,
    Takamichi Osumi


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: Backends stunk in wait event IPC/MessageQueueInternal
Next
From: 'Bruce Momjian'
Date:
Subject: Re: First draft of the PG 15 release notes