aboutsummaryrefslogtreecommitdiff
path: root/src/bin/scripts/common.h
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2015-11-12 18:05:23 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2015-11-12 18:05:23 -0300
commit83dec5a712af251af15effbf781ddaedc3bf6b3b (patch)
tree5d16c6f8dc40bd37a086f1d76deffd4ca80b758d /src/bin/scripts/common.h
parentfe702a7b3f9f2bc5bf6d173166d7d55226af82c8 (diff)
downloadpostgresql-83dec5a712af251af15effbf781ddaedc3bf6b3b.tar.gz
postgresql-83dec5a712af251af15effbf781ddaedc3bf6b3b.zip
vacuumdb: don't prompt for passwords over and over
Having the script prompt for passwords over and over was a preexisting problem when it processed multiple databases or when it processed multiple analyze stages, but the parallel mode introduced in commit a179232047 made it worse. Fix the annoyance by keeping a copy of the password used by the first connection that requires one. Since users can (currently) only have a single password, there's no need for more complex arrangements (such as remembering one password per database). Per bug #13741 reported by Eric Brown. Patch authored and cross-reviewed by Haribabu Kommi and Michael Paquier, slightly tweaked by Álvaro Herrera. Discussion: http://www.postgresql.org/message-id/20151027193919.931.54948@wrigleys.postgresql.org Backpatch to 9.5, where parallel vacuumdb was introduced.
Diffstat (limited to 'src/bin/scripts/common.h')
-rw-r--r--src/bin/scripts/common.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/scripts/common.h b/src/bin/scripts/common.h
index b5ce1ed7444..dafd58f4225 100644
--- a/src/bin/scripts/common.h
+++ b/src/bin/scripts/common.h
@@ -31,8 +31,8 @@ extern void handle_help_version_opts(int argc, char *argv[],
extern PGconn *connectDatabase(const char *dbname, const char *pghost,
const char *pgport, const char *pguser,
- enum trivalue prompt_password, const char *progname,
- bool fail_ok);
+ const char *pgpassword, enum trivalue prompt_password,
+ const char *progname, bool fail_ok);
extern PGconn *connectMaintenanceDatabase(const char *maintenance_db,
const char *pghost, const char *pgport, const char *pguser,