Skip to content

Commit 8c2dd21

Browse files
vacuumdb: Add missing PQfinish() calls to vacuum_one_database().
A few of the version checks in vacuum_one_database() do not call PQfinish() before exiting. This precedent was unintentionally established in commit 00d1e88, and while it's probably not too problematic, it seems better to properly close the connection. Reviewed-by: Daniel Gustafsson <daniel@yesql.se> Discussion: https://postgr.es/m/Z6JAwqN1I8ljTuXp%40nathan Backpatch-through: 13
1 parent 061994f commit 8c2dd21

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bin/scripts/vacuumdb.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,16 +461,25 @@ vacuum_one_database(ConnParams *cparams,
461461
}
462462

463463
if (vacopts->min_xid_age != 0 && PQserverVersion(conn) < 90600)
464+
{
465+
PQfinish(conn);
464466
pg_fatal("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
465467
"--min-xid-age", "9.6");
468+
}
466469

467470
if (vacopts->min_mxid_age != 0 && PQserverVersion(conn) < 90600)
471+
{
472+
PQfinish(conn);
468473
pg_fatal("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
469474
"--min-mxid-age", "9.6");
475+
}
470476

471477
if (vacopts->parallel_workers >= 0 && PQserverVersion(conn) < 130000)
478+
{
479+
PQfinish(conn);
472480
pg_fatal("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
473481
"--parallel", "13");
482+
}
474483

475484
if (!quiet)
476485
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy