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

Commit5194431

Browse files
committed
Simplify and merge unwanted-module drop logic in AdjustUpgrade.pm.
Inbe78006 and followups, we failed to notice that there wasalready a better way to do it: instead of using DROP DATABASEIF EXISTS, we can check the list of existing DBs. Also, thereseems no reason not to merge this into the pre-existing codefor getting rid of unwanted module databases.Discussion:https://postgr.es/m/1066872.1710006597@sss.pgh.pa.us
1 parent76904ed commit5194431

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

‎src/test/perl/PostgreSQL/Test/AdjustUpgrade.pm

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,20 @@ sub adjust_database_contents
8686

8787
# remove dbs of modules known to cause pg_upgrade to fail
8888
# anything not builtin and incompatible should clean up its own db
89-
foreachmy$bad_module ('test_ddl_deparse','tsearch2')
89+
foreachmy$bad_module ('adminpack','test_ddl_deparse','tsearch2')
9090
{
9191
if ($dbnames{"contrib_regression_$bad_module"})
9292
{
9393
_add_st($result,'postgres',
9494
"drop database contrib_regression_$bad_module");
9595
delete($dbnames{"contrib_regression_$bad_module"});
9696
}
97+
if ($dbnames{"regression_$bad_module"})
98+
{
99+
_add_st($result,'postgres',
100+
"drop database regression_$bad_module");
101+
delete($dbnames{"regression_$bad_module"});
102+
}
97103
}
98104

99105
# avoid no-path-to-downgrade-extension-version issues
@@ -106,17 +112,6 @@ sub adjust_database_contents
106112
'drop extension if exists test_ext7');
107113
}
108114

109-
# we removed the adminpack extension in v17
110-
if ($old_version < 17)
111-
{
112-
_add_st($result,'postgres',
113-
'drop database if exists contrib_regression_adminpack');
114-
_add_st($result,'postgres',
115-
'drop database if exists regression_adminpack');
116-
delete($dbnames{'contrib_regression_adminpack'});
117-
delete($dbnames{'regression_adminpack'});
118-
}
119-
120115
# we removed this test-support function in v17
121116
if ($old_version >= 15 &&$old_version < 17)
122117
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp