On Mon, Feb 22, 2021 at 11:39:46AM +0000, PG Doc comments form wrote:
> 1) pgbench has always supported the PGDATABASE env variable, but it is not
> listed along PGHOST/PGPORT & PGUSER  in 
> https://www.postgresql.org/docs/13/pgbench.html#id-1.9.4.10.8.
> PGDATABASE is listed in the pages of the psql/pg_dump/createdb...
> utilities

Yeah, let's fix that.  Adding only PGDATABASE to the list of
environment variables supported does not look enough to me, so I
propose the simple patch attached to clarify what happens to dbname in
more details.

> 2) In "Common options", it would be useful to add a warning that "-d means
> --debug and does NOT define the database, contrary to most other PostgreSQL
> utilities". 
> (It seems to work and the consequence is a flood of SQL orders on the
> screen.)

I don't agree with this part.
--
Michael
diff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgml
index faa7c26b0a..2ec0580a79 100644
--- a/doc/src/sgml/ref/pgbench.sgml
+++ b/doc/src/sgml/ref/pgbench.sgml
@@ -151,6 +151,18 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
 
     <variablelist>
 
+     <varlistentry>
+      <term><replaceable class="parameter">dbname</replaceable></term>
+      <listitem>
+       <para>
+        Specifies the name of the database to test in. If this is
+        not specified, the environment variable
+        <envar>PGDATABASE</envar> is used. If that is not set, the
+        user name specified for the connection is used.
+       </para>
+      </listitem>
+     </varlistentry>
+
      <varlistentry>
       <term><option>-i</option></term>
       <term><option>--initialize</option></term>
@@ -900,6 +912,7 @@ pgbench <optional> <replaceable>options</replaceable> </optional> <replaceable>d
 
   <variablelist>
    <varlistentry>
+    <term><envar>PGDATABASE</envar></term>
     <term><envar>PGHOST</envar></term>
     <term><envar>PGPORT</envar></term>
     <term><envar>PGUSER</envar></term>

Attachment: signature.asc
Description: PGP signature

Reply via email to