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

Commitf3e4aeb

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 parentcc2c9fa commitf3e4aeb

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
@@ -557,20 +557,32 @@ vacuum_one_database(ConnParams *cparams,
557557
}
558558

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

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

567573
if (vacopts->parallel_workers >=0&&PQserverVersion(conn)<130000)
574+
{
575+
PQfinish(conn);
568576
pg_fatal("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
569577
"--parallel","13");
578+
}
570579

571580
if (vacopts->buffer_usage_limit&&PQserverVersion(conn)<160000)
581+
{
582+
PQfinish(conn);
572583
pg_fatal("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
573584
"--buffer-usage-limit","16");
585+
}
574586

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

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp