pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgbench: supports PGDATABASE / warning about -d
3+ messages / 2 participants
[nested] [flat]

* pgbench: supports PGDATABASE / warning about -d
@ 2021-02-22 11:39 PG Doc comments form <noreply@postgresql.org>
  2021-02-24 05:29 ` Re: pgbench: supports PGDATABASE / warning about -d Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 3+ messages in thread

From: PG Doc comments form @ 2021-02-22 11:39 UTC (permalink / raw)
  To: pgsql-docs@lists.postgresql.org; +Cc: christophe.courtois@dalibo.com

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/13/legalnotice.html
Description:

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

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.)


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: pgbench: supports PGDATABASE / warning about -d
  2021-02-22 11:39 pgbench: supports PGDATABASE / warning about -d PG Doc comments form <noreply@postgresql.org>
@ 2021-02-24 05:29 ` Michael Paquier <michael@paquier.xyz>
  2021-02-25 07:09   ` Re: pgbench: supports PGDATABASE / warning about -d Michael Paquier <michael@paquier.xyz>
  0 siblings, 1 reply; 3+ messages in thread

From: Michael Paquier @ 2021-02-24 05:29 UTC (permalink / raw)
  To: christophe.courtois@dalibo.com; pgsql-docs@lists.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) download 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>
signature.asc (application/pgp-signature, 832B) download ^ permalink raw reply [nested|flat] 3+ messages in thread

* Re: pgbench: supports PGDATABASE / warning about -d
  2021-02-22 11:39 pgbench: supports PGDATABASE / warning about -d PG Doc comments form <noreply@postgresql.org>
  2021-02-24 05:29 ` Re: pgbench: supports PGDATABASE / warning about -d Michael Paquier <michael@paquier.xyz>
@ 2021-02-25 07:09   ` Michael Paquier <michael@paquier.xyz>
  0 siblings, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2021-02-25 07:09 UTC (permalink / raw)
  To: christophe.courtois@dalibo.com; pgsql-docs@lists.postgresql.org

On Wed, Feb 24, 2021 at 02:29:31PM +0900, Michael Paquier wrote:
> 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.

Applied this one as of 9e9b5c0.  5aaa584 is the original change that
updated the doc of pgbench to mention all the supported environment
variable, so this has been backpatched down to 12.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2021-02-25 07:09 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-02-22 11:39 pgbench: supports PGDATABASE / warning about -d PG Doc comments form <noreply@postgresql.org>
2021-02-24 05:29 ` Michael Paquier <michael@paquier.xyz>
2021-02-25 07:09   ` Michael Paquier <michael@paquier.xyz>

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