RE: Handle infinite recursion in logical replication setup - Mailing list pgsql-hackers

From shiy.fnst@fujitsu.com
Subject RE: Handle infinite recursion in logical replication setup
Date
Msg-id OSZPR01MB6310A0E2DDA985AAED9FD6E8FD419@OSZPR01MB6310.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: Handle infinite recursion in logical replication setup  (vignesh C <vignesh21@gmail.com>)
Responses Re: Handle infinite recursion in logical replication setup
List pgsql-hackers
On Wed, Sep 7, 2022 12:23 PM vignesh C <vignesh21@gmail.com> wrote:
> 
> 
> Thanks for the comments, the attached v47 patch has the changes for the
> same.
> 

Thanks for updating the patch.

Here is a comment.

+    for (i = 0; i < subrel_count; i++)
+    {
+        Oid            relid = subrel_local_oids[i];
+        char       *schemaname = get_namespace_name(get_rel_namespace(relid));
+        char       *tablename = get_rel_name(relid);
+
+        appendStringInfo(&cmd, "AND NOT (N.nspname = '%s' AND C.relname = '%s')\n",
+                         schemaname, tablename);
+    }

Would it be better to add "pfree(schemaname)" and "pfree(tablename)" after
calling appendStringInfo()?

Regards,
Shi yu

pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: [RFC] building postgres with meson - v12
Next
From: Kyotaro Horiguchi
Date:
Subject: Re: May be BUG. Periodic burst growth of the checkpoint_req counter on replica.