From: | Michael Paquier <michael(at)paquier(dot)xyz> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: pgbench: Simplify some port, host, user and dbname assignments |
Date: | 2021-03-06 12:32:03 |
Message-ID: | [email protected] |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
pgbench: Simplify some port, host, user and dbname assignments
Using pgbench in an environment with both PGPORT and PGUSER set would
have caused the generation of a debug log with an incorrect database
name due to an oversight in 412893b. Not specifying user, port and/or
database using the option switches, without their respective environment
variables, generated a log entry with empty strings, which was
rather useless.
This commit fixes this set of issues by simplifying the logic grabbing
the connection information, removing a set of getenv() calls that
emulated what libpq already does. The faulty debug log now directly
uses the information from the libpq connection, and it gets generated
after the connection to the backend is completed, not before it (in the
event of a failure libpq would complain with more information about the
connection attempt so the log is not really useful before anyway).
Author: Kota Miyake
Reviewed-by: Fujii Masao, Michael Paquier
Discussion: https://postgr.es/m/[email protected]
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/f1516ad7b3a9645a316846fa7b2229163bc55907
Modified Files
--------------
src/bin/pgbench/pgbench.c | 36 +++++++++++++++---------------------
1 file changed, 15 insertions(+), 21 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Magnus Hagander | 2021-03-06 16:39:52 | pgsql: Improve docs on updatable views |
Previous Message | Tom Lane | 2021-03-05 15:59:26 | pgsql: Doc: remove obsolete entries in table of BRIN strategy numbers. |