|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * 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 $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -154,7 +154,10 @@ createdb(const char *dbname, const char *dbpath,
|
154 | 154 | /* ... otherwise we'd be open to shell exploits below */
|
155 | 155 |
|
156 | 156 | #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 | + */ |
158 | 161 | BufferSync();
|
159 | 162 | #endif
|
160 | 163 |
|
@@ -251,6 +254,14 @@ createdb(const char *dbname, const char *dbpath,
|
251 | 254 |
|
252 | 255 | /* Close pg_database, but keep lock till commit */
|
253 | 256 | 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 |
254 | 265 | }
|
255 | 266 |
|
256 | 267 |
|
|