aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2025-02-04 13:26:57 -0600
committerNathan Bossart <nathan@postgresql.org>2025-02-04 13:26:57 -0600
commiteeaf6891be48ac2940361717525c277a02c97e63 (patch)
tree6015c6ca721647d5be792e50cf90f5a54732847f /src
parentd7260f92adea66791b027ad46b44b2cb7d77b555 (diff)
downloadpostgresql-eeaf6891be48ac2940361717525c277a02c97e63.tar.gz
postgresql-eeaf6891be48ac2940361717525c277a02c97e63.zip
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 00d1e88d36, 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
Diffstat (limited to 'src')
-rw-r--r--src/bin/scripts/vacuumdb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c
index dac0eac71b9..d6f36bbed26 100644
--- a/src/bin/scripts/vacuumdb.c
+++ b/src/bin/scripts/vacuumdb.c
@@ -514,6 +514,7 @@ vacuum_one_database(ConnParams *cparams,
if (vacopts->min_xid_age != 0 && PQserverVersion(conn) < 90600)
{
+ PQfinish(conn);
pg_log_error("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
"--min-xid-age", "9.6");
exit(1);
@@ -521,6 +522,7 @@ vacuum_one_database(ConnParams *cparams,
if (vacopts->min_mxid_age != 0 && PQserverVersion(conn) < 90600)
{
+ PQfinish(conn);
pg_log_error("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
"--min-mxid-age", "9.6");
exit(1);
@@ -528,6 +530,7 @@ vacuum_one_database(ConnParams *cparams,
if (vacopts->parallel_workers >= 0 && PQserverVersion(conn) < 130000)
{
+ PQfinish(conn);
pg_log_error("cannot use the \"%s\" option on server versions older than PostgreSQL %s",
"--parallel", "13");
exit(1);