Comment fixes.
authorRobert Haas <rhaas@postgresql.org>
Thu, 30 Aug 2012 14:42:28 +0000 (10:42 -0400)
committerRobert Haas <rhaas@postgresql.org>
Thu, 30 Aug 2012 14:42:28 +0000 (10:42 -0400)
Jeff Davis, somewhat edited by me

src/backend/commands/tablecmds.c
src/backend/storage/file/reinit.c

index 0d3a74ea3720eb38f644515e98535732f248c40d..359d478592b2528211f1556a75900ffd77594a77 100644 (file)
@@ -8784,9 +8784,10 @@ copy_relation_data(SMgrRelation src, SMgrRelation dst,
    pfree(buf);
 
    /*
-    * If the rel isn't temp, we must fsync it down to disk before it's safe
-    * to commit the transaction.  (For a temp rel we don't care since the rel
-    * will be uninteresting after a crash anyway.)
+    * If the rel is WAL-logged, must fsync before commit.  We use heap_sync
+    * to ensure that the toast table gets fsync'd too.  (For a temp or
+    * unlogged rel we don't care since the data will be gone after a crash
+    * anyway.)
     *
     * It's obvious that we must do this when not WAL-logging the copy. It's
     * less obvious that we have to do it even if we did WAL-log the copied
index 1912dd8e7aeb76729885475346293151c9a18061..0e2f824a885d5fe0b279b2301baf6b2ca5754af0 100644 (file)
@@ -337,7 +337,6 @@ ResetUnloggedRelationsInDbspaceDir(const char *dbspacedirname, int op)
            copy_file(srcpath, dstpath);
        }
 
-       /* Done with the first pass. */
        FreeDir(dbspace_dir);
    }
 }