RE: [PATCH] pgbench: improve \sleep meta command

2021-03-07 Thread miyake_kouta
Thank you for your comments! I fixed my patch based on your comment, and attached it to this mail. 2021-03-05 12:57, kuroda.hay...@fujitsu.com wrote: * When the following line is input, the error message is not happy. I think output should be " \sleep command argument must be an integer...".

Re: [PATCH] pgbench: Bug fix for the -d option

2021-03-04 Thread miyake_kouta
2021-03-04 21:11, Michael Paquier wrote: 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

[PATCH] pgbench: improve \sleep meta command

2021-03-04 Thread miyake_kouta
Hi. I created a patch to improve \sleep meta command in pgbench. There are two problems with the current pgbench implementation of \sleep. First, when the input is like "\sleep foo s" , this string will be treated as 0 through atoi function, and no error will be raised. Second, when the input

Re: [PATCH] psql : Improve code for help option

2021-03-02 Thread miyake_kouta
2021-03-03 00:09, Fujii Masao wrote: We can simplify the code more and remove "env = user" by just using "user" instead of "env" in the above? Thank you for your comment. I updated my patch and replaced "env" with "user". Please check. Regards. -- Kota Miyake diff --git a/src/bin/psql/help.c b

[PATCH] psql : Improve code for help option

2021-03-01 Thread miyake_kouta
Hi. I found some redundant code in psql/help.c, so I propose a patch to fix it. In the current help.c, the variable "user" is set to the value of $PGUSER (or get_user_name). However, $PGUSER is referenced again in the code that follows. We can replace this part with "user", I think. Regards.

Re: [PATCH] pgbench: Bug fix for the -d option

2021-03-01 Thread miyake_kouta
2021-02-26 20:30, Michael Paquier wrote: By the way, I can help but wonder why pgbench has such a different handling for the user name, fetching first PGUSER and then looking at the options while most of the other binaries use get_user_name(). It seems to me that we could simplify the handling a

Re: [PATCH] pgbench: Remove ecnt, a member variable of CState

2021-02-28 Thread miyake_kouta
2021-02-28 08:06, Michael Paquier wrote: On Fri, Feb 26, 2021 at 04:36:41PM -0300, Alvaro Herrera wrote: +1 Thanks, done. -- Michael Thanks for reviewing and committing this patch! Regards -- Kota Miyake

[PATCH] pgbench: Remove ecnt, a member variable of CState

2021-02-26 Thread miyake_kouta
Hi. I created a patch to remove ecnt which is a member variable of CState. This variable is incremented in some places, but it's not used for any purpose. Also, the current pgbench's client abandons processing after hitting error, so this variable is no need, I think. Regards -- Kota Miyakedi

[PATCH] pgbench: Bug fix for the -d option

2021-02-25 Thread miyake_kouta
Hi. I found a bug in pgbench's -d option and created a patch. The bug is the following: pgbench's option -d can display debug log about connection, which is like "pghost: foo pgport: 5432 nclients: 1 nxacts: 10 dbName: bar". This configuration is supplied by other options or environment variabl

[PATCH] Feature improvement for TRUNCATE tab completion.

2021-02-21 Thread miyake_kouta
Hi. I created a patch which improves psql's TRUNCATE tab completion. Current tab completion can complement only a table name to be truncated. This patch enables psql to complement other keywords related to TRUNCATE. Regards. Kota Miyakediff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/ta