@@ -1860,10 +1860,15 @@ make_template0(FILE *cmdfd)
1860
1860
* objects in the old cluster, the problem scenario only exists if the OID
1861
1861
* that is in use in the old cluster is also used in the new cluster - and
1862
1862
* the new cluster should be the result of a fresh initdb.)
1863
+ *
1864
+ * We use "STRATEGY = file_copy" here because checkpoints during initdb
1865
+ * are cheap. "STRATEGY = wal_log" would generate more WAL, which would
1866
+ * be a little bit slower and make the new cluster a little bit bigger.
1863
1867
*/
1864
1868
static const char * const template0_setup [] = {
1865
1869
"CREATE DATABASE template0 IS_TEMPLATE = true ALLOW_CONNECTIONS = false OID = "
1866
- CppAsString2 (Template0ObjectId ) ";\n\n" ,
1870
+ CppAsString2 (Template0ObjectId )
1871
+ " STRATEGY = file_copy;\n\n" ,
1867
1872
1868
1873
/*
1869
1874
* template0 shouldn't have any collation-dependent objects, so unset
@@ -1906,9 +1911,12 @@ make_postgres(FILE *cmdfd)
1906
1911
{
1907
1912
const char * const * line ;
1908
1913
1909
- /* Assign a fixed OID to postgres, for the same reasons as template0 */
1914
+ /*
1915
+ * Just as we did for template0, and for the same reasons, assign a fixed
1916
+ * OID to postgres and select the file_copy strategy.
1917
+ */
1910
1918
static const char * const postgres_setup [] = {
1911
- "CREATE DATABASE postgres OID = " CppAsString2 (PostgresObjectId ) ";\n\n" ,
1919
+ "CREATE DATABASE postgres OID = " CppAsString2 (PostgresObjectId ) " STRATEGY = file_copy ;\n\n" ,
1912
1920
"COMMENT ON DATABASE postgres IS 'default administrative connection database';\n\n" ,
1913
1921
NULL
1914
1922
};
0 commit comments