Dear Shubham,

Thanks for updating the patch! I resumed reviewing the patch set.
Here are only cosmetic comments as my rehabilitation.

01. getPublications()

I feel we could follow the notation like getSubscriptions(), because number of
parameters became larger. How do you feel like attached?


02. fetch_remote_table_info()

```
                          "SELECT DISTINCT"
-                         "  (CASE WHEN (array_length(gpt.attrs, 1) = 
c.relnatts)"
-                         "   THEN NULL ELSE gpt.attrs END)"
+                         "  (gpt.attrs)"
```

I think no need to separate lines and add bracket. How about like below?

```
                                                 "SELECT DISTINCT gpt.attrs"
```

Best regards,
Hayato Kuroda
FUJITSU LIMITED

diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c
index 1d79865058..5e2d28b447 100644
--- a/src/bin/pg_dump/pg_dump.c
+++ b/src/bin/pg_dump/pg_dump.c
@@ -4292,30 +4292,26 @@ getPublications(Archive *fout)
        query = createPQExpBuffer();
 
        /* Get the publications. */
+       appendPQExpBufferStr(query, "SELECT p.tableoid, p.oid, p.pubname, "
+                                                "p.pubowner, "
+                                                "puballtables, p.pubinsert, 
p.pubupdate, p.pubdelete, ");
+
+       if (fout->remoteVersion >= 110000)
+               appendPQExpBufferStr(query, "p.pubtruncate, ");
+       else
+               appendPQExpBufferStr(query, "false AS pubtruncate, ");
+
+       if (fout->remoteVersion >= 130000)
+               appendPQExpBufferStr(query, "p.pubviaroot, ");
+       else
+               appendPQExpBufferStr(query, "false AS pubviaroot, ");
+
        if (fout->remoteVersion >= 180000)
-               appendPQExpBufferStr(query,
-                                                        "SELECT p.tableoid, 
p.oid, p.pubname, "
-                                                        "p.pubowner, "
-                                                        "p.puballtables, 
p.pubinsert, p.pubupdate, p.pubdelete, p.pubtruncate, p.pubviaroot, 
p.pubgencols "
-                                                        "FROM pg_publication 
p");
-       else if (fout->remoteVersion >= 130000)
-               appendPQExpBufferStr(query,
-                                                        "SELECT p.tableoid, 
p.oid, p.pubname, "
-                                                        "p.pubowner, "
-                                                        "p.puballtables, 
p.pubinsert, p.pubupdate, p.pubdelete, p.pubtruncate, p.pubviaroot, false AS 
pubgencols "
-                                                        "FROM pg_publication 
p");
-       else if (fout->remoteVersion >= 110000)
-               appendPQExpBufferStr(query,
-                                                        "SELECT p.tableoid, 
p.oid, p.pubname, "
-                                                        "p.pubowner, "
-                                                        "p.puballtables, 
p.pubinsert, p.pubupdate, p.pubdelete, p.pubtruncate, false AS pubviaroot, 
false AS pubgencols "
-                                                        "FROM pg_publication 
p");
+               appendPQExpBufferStr(query, "p.pubgencols ");
        else
-               appendPQExpBufferStr(query,
-                                                        "SELECT p.tableoid, 
p.oid, p.pubname, "
-                                                        "p.pubowner, "
-                                                        "p.puballtables, 
p.pubinsert, p.pubupdate, p.pubdelete, false AS pubtruncate, false AS 
pubviaroot, false AS pubgencols "
-                                                        "FROM pg_publication 
p");
+               appendPQExpBufferStr(query, "false AS pubgencols ");
+
+       appendPQExpBufferStr(query, "FROM pg_publication p");
 
        res = ExecuteSqlQuery(fout, query->data, PGRES_TUPLES_OK);
 

Reply via email to