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

Commit375e7d5

Browse files
committed
Use a safer order of operations in dropdb(): rollbackable operations,
ie removing shared-dependency entries, should happen before non-rollbackableones. That way a failure during the rollbackable part doesn't leave uswith inconsistent state.
1 parent15a110e commit375e7d5

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

‎src/backend/commands/dbcommands.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.171 2005/08/22 17:38:20 tgl Exp $
18+
* $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.172 2005/10/10 20:02:20 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -646,6 +646,11 @@ dropdb(const char *dbname)
646646
*/
647647
DeleteComments(db_id,DatabaseRelationId,0);
648648

649+
/*
650+
* Remove shared dependency references for the database.
651+
*/
652+
dropDatabaseDependencies(db_id);
653+
649654
/*
650655
* Drop pages for this database that are in the shared buffer cache.
651656
* This is important to ensure that no remaining backend tries to
@@ -674,11 +679,6 @@ dropdb(const char *dbname)
674679
/* Close pg_database, but keep exclusive lock till commit */
675680
heap_close(pgdbrel,NoLock);
676681

677-
/*
678-
* Remove shared dependency references for the database.
679-
*/
680-
dropDatabaseDependencies(db_id);
681-
682682
/*
683683
* Set flag to update flat database file at commit.
684684
*/

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp