From: Michael Paquier <michael@paquier.xyz>
To: christophe.courtois@dalibo.com
To: pgsql-docs@lists.postgresql.org
Subject: Re: pgbench: supports PGDATABASE / warning about -d
Date: Wed, 24 Feb 2021 14:29:31 +0900
Message-ID: <YDXkO0HXIwh9ROkD@paquier.xyz> (raw)
In-Reply-To: <161399398648.21711.15387267201764682579@wrigleys.postgresql.org>
References: <161399398648.21711.15387267201764682579@wrigleys.postgresql.org>
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
Attachments:pgbench-doc-db.patch (text/x-diff, 1.1K) downloaddiff --git a/doc/src/sgml/ref/pgbench.sgml b/doc/src/sgml/ref/pgbench.sgmlindex 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>
signature.asc (application/pgp-signature, 832B) download
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: michael@paquier.xyz, christophe.courtois@dalibo.com, pgsql-docs@lists.postgresql.org
Subject: Re: pgbench: supports PGDATABASE / warning about -d
In-Reply-To: <YDXkO0HXIwh9ROkD@paquier.xyz>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox