summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Bossart2023-07-28 17:07:44 +0000
committerNathan Bossart2023-07-28 17:07:44 +0000
commit6d982e3b3bd4a3a26d18639b05ca1535c260e669 (patch)
tree67608b4aed256ad5f77fba03fc81d047e58aa566
parente055b6be7ebb0de35570102327717c99d91fe540 (diff)
Harmonize password reuse in vacuumdb, clusterdb, and reindexdb.
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
-rw-r--r--doc/src/sgml/ref/reindexdb.sgml14
-rw-r--r--doc/src/sgml/ref/vacuumdb.sgml13
-rw-r--r--src/bin/scripts/clusterdb.c2
-rw-r--r--src/bin/scripts/reindexdb.c2
-rw-r--r--src/fe_utils/connect_utils.c2
5 files changed, 3 insertions, 30 deletions
diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml
index 8cb8bf4fa39..8d9ced212f3 100644
--- a/doc/src/sgml/ref/reindexdb.sgml
+++ b/doc/src/sgml/ref/reindexdb.sgml
@@ -432,20 +432,6 @@ PostgreSQL documentation
</refsect1>
-
- <refsect1>
- <title>Notes</title>
-
- <para>
- <application>reindexdb</application> might need to connect several
- times to the <productname>PostgreSQL</productname> server, asking
- for a password each time. It is convenient to have a
- <filename>~/.pgpass</filename> file in such cases. See <xref
- linkend="libpq-pgpass"/> for more information.
- </para>
- </refsect1>
-
-
<refsect1>
<title>Examples</title>
diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml
index da2393783b7..09356ea4fae 100644
--- a/doc/src/sgml/ref/vacuumdb.sgml
+++ b/doc/src/sgml/ref/vacuumdb.sgml
@@ -605,19 +605,6 @@ PostgreSQL documentation
</refsect1>
-
- <refsect1>
- <title>Notes</title>
-
- <para>
- <application>vacuumdb</application> might need to connect several
- times to the <productname>PostgreSQL</productname> server, asking
- for a password each time. It is convenient to have a
- <filename>~/.pgpass</filename> file in such cases. See <xref
- linkend="libpq-pgpass"/> for more information.
- </para>
- </refsect1>
-
<refsect1>
<title>Examples</title>
diff --git a/src/bin/scripts/clusterdb.c b/src/bin/scripts/clusterdb.c
index 58a774013b1..65428031c74 100644
--- a/src/bin/scripts/clusterdb.c
+++ b/src/bin/scripts/clusterdb.c
@@ -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);
diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c
index 5b297d1dc16..002c41f2219 100644
--- a/src/bin/scripts/reindexdb.c
+++ b/src/bin/scripts/reindexdb.c
@@ -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)
{
diff --git a/src/fe_utils/connect_utils.c b/src/fe_utils/connect_utils.c
index 7a1edea7c8c..7d45f5c6090 100644
--- a/src/fe_utils/connect_utils.c
+++ b/src/fe_utils/connect_utils.c
@@ -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 *