Harmonize password reuse in vacuumdb, clusterdb, and reindexdb.
authorNathan Bossart
Fri, 28 Jul 2023 17:07:44 +0000 (10:07 -0700)
committerNathan Bossart
Fri, 28 Jul 2023 17:07:44 +0000 (10:07 -0700)
Commits 83dec5a712 and ff402ae11b 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

doc/src/sgml/ref/reindexdb.sgml
doc/src/sgml/ref/vacuumdb.sgml
src/bin/scripts/clusterdb.c
src/bin/scripts/reindexdb.c
src/fe_utils/connect_utils.c

index 8cb8bf4fa3924adb18572d4d22ec21387bd52a03..8d9ced212f34f8a87820aa59beb6a324ebe95518 100644 (file)
@@ -432,20 +432,6 @@ PostgreSQL documentation
 
  
 
-
-  Notes
-
-  
-   reindexdb might need to connect several
-   times to the PostgreSQL server, asking
-   for a password each time. It is convenient to have a
-   ~/.pgpass file in such cases. See 
-   linkend="libpq-pgpass"/> for more information.
-  
-
-
  
   Examples
 
index da2393783b7dc56e67a265c535a8e88e815c2180..09356ea4faeffe37e3a7206ba7c656d557e5ec82 100644 (file)
@@ -605,19 +605,6 @@ PostgreSQL documentation
 
  
 
-
-  Notes
-
-  
-   vacuumdb might need to connect several
-   times to the PostgreSQL server, asking
-   for a password each time. It is convenient to have a
-   ~/.pgpass file in such cases. See 
-   linkend="libpq-pgpass"/> for more information.
-  
-
  
   Examples
 
index 58a774013b1a9e9cb0a50a39fc2f19d76103374e..65428031c747e4cb0abccbbc7f7f3c8c6f04b9a8 100644 (file)
@@ -195,7 +195,7 @@ cluster_one_database(const ConnParams *cparams, const char *table,
 
    PGconn     *conn;
 
-   conn = connectDatabase(cparams, progname, echo, false, false);
+   conn = connectDatabase(cparams, progname, echo, false, true);
 
    initPQExpBuffer(&sql);
 
index 5b297d1dc163d727a8331c6573af4371664df9c3..002c41f22191249fae7006661c7f85af2a4feed4 100644 (file)
@@ -315,7 +315,7 @@ reindex_one_database(ConnParams *cparams, ReindexType type,
    bool        failed = false;
    int         items_count = 0;
 
-   conn = connectDatabase(cparams, progname, echo, false, false);
+   conn = connectDatabase(cparams, progname, echo, false, true);
 
    if (concurrently && PQserverVersion(conn) < 120000)
    {
index 7a1edea7c8cd9f3d49987e2c46ad17c34158f757..7d45f5c6090494ecdd1c4eeba0c82d5eba255fe3 100644 (file)
@@ -25,7 +25,7 @@
  *
  * If allow_password_reuse is true, we will try to re-use any password
  * given during previous calls to this routine.  (Callers should not pass
- * allow_password_reuse=true unless reconnecting to the same database+user
+ * allow_password_reuse=true unless reconnecting to the same host+port+user
  * as before, else we might create password exposure hazards.)
  */
 PGconn *