gongxun0928 commented on code in PR #1252:
URL: https://github.com/apache/cloudberry/pull/1252#discussion_r2228102848
##########
src/bin/pg_dump/pg_dump.c:
##########
@@ -18111,13 +18111,30 @@ dumpTableSchema(Archive *fout, const TableInfo
*tbinfo)
actual_atts = 0;
if (nonemptyReloptions(tbinfo->reloptions) ||
- nonemptyReloptions(tbinfo->toast_reloptions))
+ nonemptyReloptions(tbinfo->toast_reloptions) ||
+ (tbinfo->amoid &&
+ (tbinfo->amoid == AO_ROW_TABLE_AM_OID ||
+ tbinfo->amoid == AO_COLUMN_TABLE_AM_OID)))
{
bool addcomma = false;
appendPQExpBufferStr(q, "\nWITH (");
+ if (tbinfo->amoid && tbinfo->amoid ==
AO_ROW_TABLE_AM_OID)
+ {
+ addcomma = true;
+ appendPQExpBufferStr(q, "appendonly = true");
+ }
+ else if (tbinfo->amoid && tbinfo->amoid ==
AO_COLUMN_TABLE_AM_OID)
+ {
+ addcomma = true;
+ appendPQExpBufferStr(q, "appendonly = true,
orientation = column");
+ }
+
if (nonemptyReloptions(tbinfo->reloptions))
{
+ if (addcomma)
+ appendPQExpBufferStr(q, ", ");
+
addcomma = true;
appendReloptionsArrayAH(q, tbinfo->reloptions,
"", fout);
}
Review Comment:
This logic can be moved to the end, just before adding the closing ')'. By
doing so, we won't need to handle the comma logic separately.
```
if (tbinfo->amoid && tbinfo->amoid == AO_ROW_TABLE_AM_OID)
{
appendPQExpBufferStr(q, ", appendonly = true");
}
else if (tbinfo->amoid && tbinfo->amoid == AO_COLUMN_TABLE_AM_OID)
{
appendPQExpBufferStr(q, ", appendonly = true, orientation = column");
}
--
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]