From 5094da99b901df42580b6e7494d036ee4be9eb81 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 12 Nov 2015 18:05:23 -0300 Subject: vacuumdb: don't prompt for passwords over and over MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- src/bin/scripts/dropuser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/bin/scripts/dropuser.c') diff --git a/src/bin/scripts/dropuser.c b/src/bin/scripts/dropuser.c index 916056662b6..10d0691c677 100644 --- a/src/bin/scripts/dropuser.c +++ b/src/bin/scripts/dropuser.c @@ -128,8 +128,8 @@ main(int argc, char *argv[]) appendPQExpBuffer(&sql, "DROP ROLE %s%s;", (if_exists ? "IF EXISTS " : ""), fmtId(dropuser)); - conn = connectDatabase("postgres", host, port, username, prompt_password, - progname, false); + conn = connectDatabase("postgres", host, port, username, NULL, + prompt_password, progname, false); if (echo) printf("%s\n", sql.data); -- cgit v1.2.3