Skip to content

Commit 6d982e3

Browse files
Harmonize password reuse in vacuumdb, clusterdb, and reindexdb.
Commits 83dec5a and ff402ae taught vacuumdb to reuse passwords instead of prompting repeatedly. However, the docs still warn about repeated prompts, and this improvement was not applied to clusterdb and reindexdb. This commit allows clusterdb and reindexdb to reuse passwords just like vacuumdb does, and it expunges the aforementioned warnings from the docs. Reviewed-by: Gurjeet Singh, Zhang Mingli Discussion: https://postgr.es/m/20230628045741.GA1813397%40nathanxps13
1 parent e055b6b commit 6d982e3

File tree

5 files changed

+3
-30
lines changed

5 files changed

+3
-30
lines changed

doc/src/sgml/ref/reindexdb.sgml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -432,20 +432,6 @@ PostgreSQL documentation
432432

433433
</refsect1>
434434

435-
436-
<refsect1>
437-
<title>Notes</title>
438-
439-
<para>
440-
<application>reindexdb</application> might need to connect several
441-
times to the <productname>PostgreSQL</productname> server, asking
442-
for a password each time. It is convenient to have a
443-
<filename>~/.pgpass</filename> file in such cases. See <xref
444-
linkend="libpq-pgpass"/> for more information.
445-
</para>
446-
</refsect1>
447-
448-
449435
<refsect1>
450436
<title>Examples</title>
451437

doc/src/sgml/ref/vacuumdb.sgml

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -605,19 +605,6 @@ PostgreSQL documentation
605605

606606
</refsect1>
607607

608-
609-
<refsect1>
610-
<title>Notes</title>
611-
612-
<para>
613-
<application>vacuumdb</application> might need to connect several
614-
times to the <productname>PostgreSQL</productname> server, asking
615-
for a password each time. It is convenient to have a
616-
<filename>~/.pgpass</filename> file in such cases. See <xref
617-
linkend="libpq-pgpass"/> for more information.
618-
</para>
619-
</refsect1>
620-
621608
<refsect1>
622609
<title>Examples</title>
623610

src/bin/scripts/clusterdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ cluster_one_database(const ConnParams *cparams, const char *table,
195195

196196
PGconn *conn;
197197

198-
conn = connectDatabase(cparams, progname, echo, false, false);
198+
conn = connectDatabase(cparams, progname, echo, false, true);
199199

200200
initPQExpBuffer(&sql);
201201

src/bin/scripts/reindexdb.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ reindex_one_database(ConnParams *cparams, ReindexType type,
315315
bool failed = false;
316316
int items_count = 0;
317317

318-
conn = connectDatabase(cparams, progname, echo, false, false);
318+
conn = connectDatabase(cparams, progname, echo, false, true);
319319

320320
if (concurrently && PQserverVersion(conn) < 120000)
321321
{

src/fe_utils/connect_utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
*
2626
* If allow_password_reuse is true, we will try to re-use any password
2727
* given during previous calls to this routine. (Callers should not pass
28-
* allow_password_reuse=true unless reconnecting to the same database+user
28+
* allow_password_reuse=true unless reconnecting to the same host+port+user
2929
* as before, else we might create password exposure hazards.)
3030
*/
3131
PGconn *

0 commit comments

Comments
 (0)