Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qENFW-0007PP-10 for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jun 2023 04:57:50 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qENFU-0004V2-Uc for pgsql-hackers@arkaria.postgresql.org; Wed, 28 Jun 2023 04:57:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qENFU-0004Uj-LS for pgsql-hackers@lists.postgresql.org; Wed, 28 Jun 2023 04:57:48 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qENFR-000uP6-Q3 for pgsql-hackers@postgresql.org; Wed, 28 Jun 2023 04:57:48 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1b7f2239bfdso32962785ad.1 for ; Tue, 27 Jun 2023 21:57:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687928264; x=1690520264; h=content-disposition:mime-version:message-id:subject:to:from:date :from:to:cc:subject:date:message-id:reply-to; bh=9OO4RVkRsiT1rFtKKOF+nQP+gkQOq24Y/JyLMpdc6eo=; b=L34QcUDB6iUQpwr4rU0FV5en+5dsllTTaI4Y15ABY4dRzTlN0Sm5wmecB3AWUgncPG Q8FBqWSu+9D/g+B09wXFngqogPhx+g+63rjD+Tx4afw5OdN4YmdTvFqLS+A3VMub8Gdp aHAZKdea06u4DbBAaNnS+2wqgFvUm8ATH/fZejclX2QlT4hyewjxDA/rEul4tGoMp8Qv EthwSS7TU0hVvP9E2OqFKVHanD1ScYc3ZSaxwddAwnnR1OtGwCaiGV8756irt1ltIpoe OmEjTEjzcfrZ9InE4DG+S3hzwQPqgGYFqQhlpqyib/B/blhDi8kI4ZBMvXh68RB21fQc AMyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687928264; x=1690520264; h=content-disposition:mime-version:message-id:subject:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=9OO4RVkRsiT1rFtKKOF+nQP+gkQOq24Y/JyLMpdc6eo=; b=PxpS9QIaIU+vT17ylKHD90wKpRRlW1VEPjXiyLHrO11B+drWyawUWwqLYxB3gxYMbM lsyLVI3tobtXrPgDWyqsqf7WxkBROMXgqLsI872ppaKBVPXcpedwdEGtA8AFMuQOT3In DuIZNA31LWkHxMfblXj7q/TTRfP/4ld+90HQYhjC+UaTKk+wgz1ai25Ts718ECKrVZ/o ig1wGriMxwrksa0V1X09FVFUQzQlNogMdCxzQwk7jHOzOzC3hDP0ttK8fBex4womo6qz Oo1Wtvs/U8SXswslFo3fwbaAXrRXg1SVriiNNOjl7ivBu1Yr1gH8h802hwywtfOJwzJI 2v6Q== X-Gm-Message-State: AC+VfDzJ2LS48vtYDzcK2WRFg3Elx55JKIOB47c3myMof+fQaXxuJodd bYs9QmwmvrzsZ1a8i4Z9UzoosDUjJgo= X-Google-Smtp-Source: ACHHUZ7qb5nMjvO+FIE7QaajSN4ZuGRgC9l+DEBlwuurUSdUTJwpeMz/RiYTIOWwNSO5xNexZ0NoQg== X-Received: by 2002:a17:902:7445:b0:1b6:69dc:44d2 with SMTP id e5-20020a170902744500b001b669dc44d2mr13728996plt.51.1687928263677; Tue, 27 Jun 2023 21:57:43 -0700 (PDT) Received: from nathanxps13 ([50.47.162.83]) by smtp.gmail.com with ESMTPSA id c8-20020a170902724800b001b3d44788f4sm6750383pll.9.2023.06.27.21.57.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jun 2023 21:57:43 -0700 (PDT) Date: Tue, 27 Jun 2023 21:57:41 -0700 From: Nathan Bossart To: pgsql-hackers@postgresql.org Subject: harmonize password reuse in vacuumdb, clusterdb, and reindexdb Message-ID: <20230628045741.GA1813397@nathanxps13> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="n8g4imXOkfNTN/H1" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --n8g4imXOkfNTN/H1 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline While looking at something unrelated, I noticed that the vacuumdb docs mention the following: vacuumdb might need to connect several times to the PostgreSQL server, asking for a password each time. IIUC this has been fixed since 83dec5a from 2015 (which was superceded by ff402ae), so I think this note (originally added in e0a77f5 from 2002) can now be removed. I also found that neither clusterdb nor reindexdb uses the allow_password_reuse parameter in connectDatabase(), and the reindexdb documentation contains the same note about repeatedly asking for a password (originally added in 85e9a5a from 2005). IMO we should allow password reuse for all three programs, and we should remove the aforementioned notes in the docs, too. This is what the attached patch does. Thoughts? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com --n8g4imXOkfNTN/H1 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-harmonize-password-reuse-in-vacuumdb-clusterdb-an.patch" From e6fa53e7a2b0903fc6a498f22f6b436b81b206ed Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 27 Jun 2023 21:38:24 -0700 Subject: [PATCH v1 1/1] harmonize password reuse in vacuumdb, clusterdb, and reindexdb --- doc/src/sgml/ref/reindexdb.sgml | 14 -------------- doc/src/sgml/ref/vacuumdb.sgml | 13 ------------- src/bin/scripts/clusterdb.c | 2 +- src/bin/scripts/reindexdb.c | 2 +- 4 files changed, 2 insertions(+), 29 deletions(-) diff --git a/doc/src/sgml/ref/reindexdb.sgml b/doc/src/sgml/ref/reindexdb.sgml index 8cb8bf4fa3..8d9ced212f 100644 --- a/doc/src/sgml/ref/reindexdb.sgml +++ b/doc/src/sgml/ref/reindexdb.sgml @@ -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 for more information. - - - - Examples diff --git a/doc/src/sgml/ref/vacuumdb.sgml b/doc/src/sgml/ref/vacuumdb.sgml index da2393783b..09356ea4fa 100644 --- a/doc/src/sgml/ref/vacuumdb.sgml +++ b/doc/src/sgml/ref/vacuumdb.sgml @@ -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 for more information. - - - Examples diff --git a/src/bin/scripts/clusterdb.c b/src/bin/scripts/clusterdb.c index e3585b3272..1a7588d29c 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 3e8f6aca40..2eee8e351f 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) { -- 2.25.1 --n8g4imXOkfNTN/H1--