postgresql/src
Michael Paquier f1516ad7b3 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/026b3ae6fc339a18394d053c32a4463d@oss.nttdata.com
2021-03-06 21:26:34 +09:00
..
backend Remove server and libpq support for old FE/BE protocol version 2. 2021-03-04 10:45:55 +02:00
bin pgbench: Simplify some port, host, user and dbname assignments 2021-03-06 21:26:34 +09:00
common pg_upgrade: Check version of target cluster binaries 2021-03-03 09:45:56 +01:00
fe_utils Generalize parallel slot result handling. 2021-02-05 16:08:45 -05:00
include Remove server and libpq support for old FE/BE protocol version 2. 2021-03-04 10:45:55 +02:00
interfaces Avoid extra newline in errors received in FE protocol version 2. 2021-03-04 10:56:33 +02:00
makefiles Remove libpq.rc, use win32ver.rc for libpq 2020-01-15 15:06:12 +01:00
pl Remove extra increment of plpgsql's statement counter for FOR loops. 2021-02-02 14:35:12 -05:00
port Use sort_template.h for qsort() and qsort_arg(). 2021-03-03 17:02:32 +13:00
template Further tweaking of PG_SYSROOT heuristics for macOS. 2021-01-20 12:07:23 -05:00
test Close psql processes gracefully in recovery tests 2021-03-04 13:23:41 -05:00
timezone Update time zone data files to tzdata release 2021a. 2021-01-24 16:29:47 -05:00
tools Add support for PROVE_TESTS and PROVE_FLAGS in MSVC scripts 2021-03-05 10:12:49 +09:00
tutorial Doc, more or less: uncomment tutorial example that was fixed long ago. 2021-01-13 16:00:03 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Introduce --with-ssl={openssl} as a configure option 2021-02-01 19:19:44 +09:00
Makefile.shlib Add PostgreSQL home page to --help output 2020-02-28 13:12:21 +01:00
nls-global.mk NLS: Fix backend gettext triggers 2019-09-23 09:04:20 +02:00