public inbox for pgsql-general@postgresql.org  
help / color / mirror / Atom feed
From: Dilip Kumar <dilipbalaut@gmail.com>
To: Ajin Cherian <itsajin@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Zheng Li <zhengli10@gmail.com>
Cc: Alvaro Herrera <alvherre@alvh.no-ip.org>
Cc: houzj.fnst@fujitsu.com <houzj.fnst@fujitsu.com>
Cc: Peter Smith <smithpb2250@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>
Cc: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Japin Li <japinli@hotmail.com>
Cc: rajesh singarapu <rajesh.rs0541@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Support logical replication of DDLs
Date: Wed, 12 Oct 2022 11:37:51 +0530
Message-ID: <CAFiTN-tWkJW-JEGANkK+O3KXUjv_Yb5Tb+r83ujbognHG_brTA@mail.gmail.com> (raw)
In-Reply-To: <CAFPTHDZmS2PrOyJx8OAe+Nt-Fx4-GZetJatqCEJhDNXA2orwCg@mail.gmail.com>
References: <CAAD30UKg8rXeGM8Oy_MAmxKBL_K5DiHXdeNF=hUefcu1C_6VfQ@mail.gmail.com>
	<20221006171601.6um4ey5idm4h62vf@alvherre.pgsql>
	<CAAD30UJh+LcUND+zg_A5dbQ_Bi=m_n7qUfKrOwAx2v4jBKWvKQ@mail.gmail.com>
	<CAFPTHDbVujj6C3TdMCmoBXovpc4=5Ow3i5M1_HNhmnqdiA5qSA@mail.gmail.com>
	<CAAD30UKCCpMTZd4WSSxYu-qRAEFd+0kjXTgje+EXHdo1JTkz0g@mail.gmail.com>
	<CALDaNm3F9GvQ9bPrxobhqkUKP3HmrRZGCU3EX0xt3=Ef0-Reaw@mail.gmail.com>
	<CAFPTHDY2O42ouQFMeEbPt51CWQ=zyzYhgK6B9basyd5PLaOv0A@mail.gmail.com>
	<CAFPTHDZmS2PrOyJx8OAe+Nt-Fx4-GZetJatqCEJhDNXA2orwCg@mail.gmail.com>

On Tue, Oct 11, 2022 at 7:00 PM Ajin Cherian <itsajin@gmail.com> wrote:
>

I was going through 0001 patch and I have a few comments/suggestions.

1.

@@ -6001,7 +6001,7 @@ getObjectIdentityParts(const ObjectAddress *object,
                 transformType = format_type_be_qualified(transform->trftype);
                 transformLang = get_language_name(transform->trflang, false);

-                appendStringInfo(&buffer, "for %s on language %s",
+                appendStringInfo(&buffer, "for %s language %s",
                                  transformType,
                                  transformLang);


How is this change related to this patch?

2.
+typedef struct ObjTree
+{
+    slist_head    params;
+    int            numParams;
+    StringInfo    fmtinfo;
+    bool        present;
+} ObjTree;
+
+typedef struct ObjElem
+{
+    char       *name;
+    ObjType        objtype;
+
+    union
+    {
+        bool        boolean;
+        char       *string;
+        int64        integer;
+        float8        flt;
+        ObjTree       *object;
+        List       *array;
+    } value;
+    slist_node    node;
+} ObjElem;

It would be good to explain these structure members from readability pov.

3.

+
+bool verbose = true;
+

I do not understand the usage of such global variables.  Even if it is
required, add some comments to explain the purpose of it.


4.
+/*
+ * Given a CollectedCommand, return a JSON representation of it.
+ *
+ * The command is expanded fully, so that there are no ambiguities even in the
+ * face of search_path changes.
+ */
+Datum
+ddl_deparse_to_json(PG_FUNCTION_ARGS)
+{

It will be nice to have a test case for this utility function.

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com





reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: dilipbalaut@gmail.com, itsajin@gmail.com, vignesh21@gmail.com, zhengli10@gmail.com, alvherre@alvh.no-ip.org, houzj.fnst@fujitsu.com, smithpb2250@gmail.com, amit.kapila16@gmail.com, sawada.mshk@gmail.com, japinli@hotmail.com, rajesh.rs0541@gmail.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Support logical replication of DDLs
  In-Reply-To: <CAFiTN-tWkJW-JEGANkK+O3KXUjv_Yb5Tb+r83ujbognHG_brTA@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox