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

Commit8703cde

Browse files
vacuumdb: Add missing PQfinish() calls to vacuum_one_database().
A few of the version checks in vacuum_one_database() do not callPQfinish() before exiting. This precedent was unintentionallyestablished in commit00d1e88, and while it's probably not tooproblematic, it seems better to properly close the connection.Reviewed-by: Daniel Gustafsson <daniel@yesql.se>Discussion:https://postgr.es/m/Z6JAwqN1I8ljTuXp%40nathanBackpatch-through: 13
1 parent2548349 commit8703cde

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎src/bin/scripts/vacuumdb.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -558,20 +558,32 @@ vacuum_one_database(ConnParams *cparams,
558558
}
559559

560560
if (vacopts->min_xid_age!=0&&PQserverVersion(conn)<90600)
561+
{
562+
PQfinish(conn);
561563
pg_fatal("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
562564
"--min-xid-age","9.6");
565+
}
563566

564567
if (vacopts->min_mxid_age!=0&&PQserverVersion(conn)<90600)
568+
{
569+
PQfinish(conn);
565570
pg_fatal("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
566571
"--min-mxid-age","9.6");
572+
}
567573

568574
if (vacopts->parallel_workers >=0&&PQserverVersion(conn)<130000)
575+
{
576+
PQfinish(conn);
569577
pg_fatal("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
570578
"--parallel","13");
579+
}
571580

572581
if (vacopts->buffer_usage_limit&&PQserverVersion(conn)<160000)
582+
{
583+
PQfinish(conn);
573584
pg_fatal("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
574585
"--buffer-usage-limit","16");
586+
}
575587

576588
/* skip_database_stats is used automatically if server supports it */
577589
vacopts->skip_database_stats= (PQserverVersion(conn) >=160000);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp