|
8 | 8 | *
|
9 | 9 | *
|
10 | 10 | * IDENTIFICATION
|
11 |
| - * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.70 2000/11/30 08:46:22 vadim Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/commands/dbcommands.c,v 1.71 2001/01/14 22:14:10 tgl Exp $ |
12 | 12 | *
|
13 | 13 | *-------------------------------------------------------------------------
|
14 | 14 | */
|
@@ -153,7 +153,8 @@ createdb(const char *dbname, const char *dbpath,
|
153 | 153 | elog(ERROR, "database path may not contain single quotes");
|
154 | 154 | /* ... otherwise we'd be open to shell exploits below */
|
155 | 155 |
|
156 |
| - /* Force dirty buffers out to disk, to ensure source database is |
| 156 | + /* |
| 157 | + * Force dirty buffers out to disk, to ensure source database is |
157 | 158 | * up-to-date for the copy. (We really only need to flush buffers
|
158 | 159 | * for the source database...)
|
159 | 160 | */
|
@@ -253,7 +254,8 @@ createdb(const char *dbname, const char *dbpath,
|
253 | 254 | /* Close pg_database, but keep lock till commit */
|
254 | 255 | heap_close(pg_database_rel, NoLock);
|
255 | 256 |
|
256 |
| - /* Force dirty buffers out to disk, so that newly-connecting backends |
| 257 | + /* |
| 258 | + * Force dirty buffers out to disk, so that newly-connecting backends |
257 | 259 | * will see the new database in pg_database right away. (They'll see
|
258 | 260 | * an uncommitted tuple, but they don't care; see GetRawDatabaseInfo.)
|
259 | 261 | */
|
@@ -369,6 +371,14 @@ dropdb(const char *dbname)
|
369 | 371 | * Remove the database's subdirectory and everything in it.
|
370 | 372 | */
|
371 | 373 | remove_dbdirs(nominal_loc, alt_loc);
|
| 374 | + |
| 375 | + /* |
| 376 | + * Force dirty buffers out to disk, so that newly-connecting backends |
| 377 | + * will see the database tuple marked dead in pg_database right away. |
| 378 | + * (They'll see an uncommitted deletion, but they don't care; see |
| 379 | + * GetRawDatabaseInfo.) |
| 380 | + */ |
| 381 | + BufferSync(); |
372 | 382 | }
|
373 | 383 |
|
374 | 384 |
|
|
0 commit comments