Subject: [PATCH 7/7] Add a comment to ATExecSetTableSpace.

From: Kyotaro Horiguchi <[email-masked]>
Date: Mon, 25 Mar 2019 20:39:21 +0900

We use heap_register_sync() stuff to control WAL-logging and file sync
on bulk insertion, but we cannot use it because the function lacks the
ability to handle forks explicitly. Add a comment to explain that.
---
 src/backend/commands/tablecmds.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/backend/commands/tablecmds.c b/src/backend/commands/tablecmds.c
index 242311b0d7..c7c7bcb308 100644
--- a/src/backend/commands/tablecmds.c
+++ b/src/backend/commands/tablecmds.c
@@ -11594,7 +11594,13 @@ ATExecSetTableSpace(Oid tableOid, Oid newTableSpace, LOCKMODE lockmode)
 	RelationInvalidateWALRequirements(rel);
 	RelationCreateStorage(newrnode, rel->rd_rel->relpersistence);
 
-	/* copy main fork */
+	/*
+	 * copy main fork
+	 *
+	 * You might think that we could use heap_register_sync() to control file
+	 * sync and WAL-logging, but we cannot because the sutff lacks the ability
+	 * to handle each fork explicitly.
+	 */
 	copy_relation_data(rel->rd_smgr, dstrel, MAIN_FORKNUM,
 					   rel->rd_rel->relpersistence);
 
-- 
2.16.3

----Next_Part(Mon_Mar_25_21_32_04_2019_838)----