diff options
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r-- | src/backend/commands/dbcommands.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c index 4ceb962fb95..34b6da99df9 100644 --- a/src/backend/commands/dbcommands.c +++ b/src/backend/commands/dbcommands.c @@ -13,7 +13,7 @@ * * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.196 2007/06/28 00:02:38 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.197 2007/08/01 22:45:08 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -515,7 +515,11 @@ createdb(const CreatedbStmt *stmt) heap_close(pg_database_rel, NoLock); /* - * Set flag to update flat database file at commit. + * Set flag to update flat database file at commit. Note: this also + * forces synchronous commit, which minimizes the window between + * creation of the database files and commital of the transaction. + * If we crash before committing, we'll have a DB that's taking up + * disk space but is not in pg_database, which is not good. */ database_file_update_needed(); } @@ -675,7 +679,11 @@ dropdb(const char *dbname, bool missing_ok) heap_close(pgdbrel, NoLock); /* - * Set flag to update flat database file at commit. + * Set flag to update flat database file at commit. Note: this also + * forces synchronous commit, which minimizes the window between + * removal of the database files and commital of the transaction. + * If we crash before committing, we'll have a DB that's gone on disk + * but still there according to pg_database, which is not good. */ database_file_update_needed(); } |