|From:||Michael Paquier <michael(at)paquier(dot)xyz>|
|Cc:||Pgsql Hackers <pgsql-hackers(at)postgresql(dot)org>|
|Subject:||Re: [PATCH] pgbench: Bug fix for the -d option|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
On Tue, Mar 02, 2021 at 11:52:33AM +0900, miyake_kouta wrote:
> I modified the patch based on other binaries.
> In this new patch, if there is a $PGUSER, then it's set to login.
> If not, get_user_name_or_exit is excuted.
> Plese let me know what you think about this change.
Your patch makes the database selection slightly better, but I think
that we can do better and simpler than that. So please see the
One thing on HEAD that looks like a bug to me is that if one uses a
pgbench command without specifying user, port and/or name in the
command for an environment without PGDATABASE, PGPORT and PGHOST set,
then the debug log just before doConnect() prints empty strings for
all that, which is basically useless so one has no idea where the
connection happens. Like any other src/bin/ facilities, let's instead
remove all the getenv() calls at the beginning of pgbench.c and let's
libpq handle those environment variables if the parameters are NULL
(aka in the case of no values given directly in the options). This
requires to move the debug log after doConnect(), which is no big deal
anyway as a failure results in an exit(1) immediately with a log
telling where the connection failed.
What do you think?
|Next Message||Bharath Rupireddy||2021-03-04 12:36:45||Re: Improvements and additions to COPY progress reporting|
|Previous Message||Amit Kapila||2021-03-04 12:05:01||Re: Parallel INSERT (INTO ... SELECT ...)|