ZTE-EBASE commented on code in PR #1176:
URL: https://github.com/apache/cloudberry/pull/1176#discussion_r2188871182


##########
src/bin/pg_dump/pg_dump.c:
##########
@@ -2753,34 +2785,41 @@ dumpTableData(Archive *fout, const TableDataInfo 
*tdinfo)
        PQExpBuffer copyBuf = createPQExpBuffer();
        PQExpBuffer clistBuf = createPQExpBuffer();
        DataDumperPtr dumpFn;
+       char       *tdDefn = NULL;
        char       *copyStmt;
        const char *copyFrom;
 
        /* We had better have loaded per-column details about this table */
        Assert(tbinfo->interesting);
 
+       /*
+        * When load-via-partition-root is set or forced, get the root table 
name
+        * for the partition table, so that we can reload data through the root
+        * table.  Then construct a comment to be inserted into the TOC entry's
+        * defn field, so that such cases can be identified reliably.
+        */
+       if (tbinfo->ispartition &&
+           (dopt->load_via_partition_root ||
+            forcePartitionRootLoad(tbinfo)))
+       {
+           TableInfo  *parentTbinfo;
+
+           parentTbinfo = getRootTableInfo(tbinfo);
+           copyFrom = fmtQualifiedDumpable(parentTbinfo);
+           printfPQExpBuffer(copyBuf, "-- load via partition root %s",

Review Comment:
   Got it - appreciate the suggestion! Using "--load-via-partition-root..." 
instead makes things clearer. I'll align the comments with the CLI option 
format for consistency. Thanks!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to