Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitaa21da2

Browse files
committed
Put back BufferSync() for WAL after database creation.
Also, add some comments about what it's for...
1 parent52aa720 commitaa21da2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

‎src/backend/commands/dbcommands.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.68 2000/11/16 22:30:18 tgl Exp $
11+
* $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.69 2000/11/18 03:36:48 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -154,7 +154,10 @@ createdb(const char *dbname, const char *dbpath,
154154
/* ... otherwise we'd be open to shell exploits below */
155155

156156
#ifdefXLOG
157-
/* Try to force any dirty buffers out to disk */
157+
/* Force dirty buffers out to disk, to ensure source database is
158+
* up-to-date for the copy. (We really only need to flush buffers
159+
* for the source database...)
160+
*/
158161
BufferSync();
159162
#endif
160163

@@ -251,6 +254,14 @@ createdb(const char *dbname, const char *dbpath,
251254

252255
/* Close pg_database, but keep lock till commit */
253256
heap_close(pg_database_rel,NoLock);
257+
258+
#ifdefXLOG
259+
/* Force dirty buffers out to disk, so that newly-connecting backends
260+
* will see the new database in pg_database right away. (They'll see
261+
* an uncommitted tuple, but they don't care; see GetRawDatabaseInfo.)
262+
*/
263+
BufferSync();
264+
#endif
254265
}
255266

256267

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp