vacuumdb: don't prompt for passwords over and over
Alvaro Herrera <alvherre@alvh.no-ip.org>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/scripts/clusterdb.c | modified | +1 −1 |
| src/bin/scripts/common.c | modified | +24 −15 |
| src/bin/scripts/common.h | modified | +2 −2 |
| src/bin/scripts/createlang.c | modified | +4 −4 |
| src/bin/scripts/createuser.c | modified | +2 −2 |
| src/bin/scripts/droplang.c | modified | +4 −4 |
| src/bin/scripts/dropuser.c | modified | +2 −2 |
| src/bin/scripts/reindexdb.c | modified | +4 −4 |
| src/bin/scripts/vacuumdb.c | modified | +55 −11 |
Discussion
- BUG #13741: vacuumdb does not accept valid password 33 messages · 2015-10-27 → 2015-12-24