Thread
Commits
-
Remove pgbench's restriction on placement of -M switch.
- 79681844297a 10.0 landed
-
Confusing error message in pgbench
Tatsuo Ishii <ishii@sraoss.co.jp> — 2017-08-02T02:03:28Z
I found an error message in pgbench is quite confusing. pgbench -S -M extended -c 1 -T 30 test query mode (-M) should be specified before any transaction scripts (-f or -b) Since there's no -f or -b option is specified, users will be confused. Actually the error occurs because pgbench implicitly introduces a built in script for -S. To eliminate the confusion, I think the error message should be fixed like this: query mode (-M) should be specified before transaction type (-S or -N) or any transaction scripts (-f or -b) Patch attached. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp
-
Re: Confusing error message in pgbench
Robert Haas <robertmhaas@gmail.com> — 2017-08-02T12:22:02Z
On Tue, Aug 1, 2017 at 10:03 PM, Tatsuo Ishii <ishii@sraoss.co.jp> wrote: > I found an error message in pgbench is quite confusing. > > pgbench -S -M extended -c 1 -T 30 test > query mode (-M) should be specified before any transaction scripts (-f or -b) > > Since there's no -f or -b option is specified, users will be > confused. Actually the error occurs because pgbench implicitly > introduces a built in script for -S. To eliminate the confusion, I > think the error message should be fixed like this: > > query mode (-M) should be specified before transaction type (-S or -N) or any transaction scripts (-f or -b) > > Patch attached. Not really objecting, but an even better fix might be to remove the restriction on the order in which the options can be specified. -- Robert Haas EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company
-
Re: Confusing error message in pgbench
Fabien COELHO <coelho@cri.ensmp.fr> — 2017-08-02T15:26:24Z
Hello Tatsuo-san, > I found an error message in pgbench is quite confusing. > > pgbench -S -M extended -c 1 -T 30 test > query mode (-M) should be specified before any transaction scripts (-f or -b) > > Since there's no -f or -b option is specified, users will be > confused. Indeed. > Actually the error occurs because pgbench implicitly introduces a built > in script for -S. To eliminate the confusion, I think the error message > should be fixed like this: The idea is that -S/-N documentations say that it is just a shortcut for -b, but the explanation (eg --help) is too far away. > query mode (-M) should be specified before transaction type (-S or -N) > or any transaction scripts (-f or -b) I would suggest to make it even shorter, see attached: query mode (-M) should be specified before any transaction scripts (-f, -b, -S or -N). I'm wondering whether it could/should be "any transaction script". My English level does not allow to decide. -- Fabien.
-
Re: Confusing error message in pgbench
Tom Lane <tgl@sss.pgh.pa.us> — 2017-08-02T19:45:05Z
Robert Haas <robertmhaas@gmail.com> writes: > On Tue, Aug 1, 2017 at 10:03 PM, Tatsuo Ishii <ishii@sraoss.co.jp> wrote: >> I found an error message in pgbench is quite confusing. > Not really objecting, but an even better fix might be to remove the > restriction on the order in which the options can be specified. Indeed. It doesn't look that hard: AFAICS the problem is just that process_sql_command() is making premature decisions about whether to extract parameters from the SQL commands. Proposed patch attached. regards, tom lane
-
Re: Confusing error message in pgbench
Tatsuo Ishii <ishii@sraoss.co.jp> — 2017-08-02T23:01:35Z
> Not really objecting, but an even better fix might be to remove the > restriction on the order in which the options can be specified. +100 :-) Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp
-
Re: Confusing error message in pgbench
Tatsuo Ishii <ishii@sraoss.co.jp> — 2017-08-03T00:53:46Z
>> Not really objecting, but an even better fix might be to remove the >> restriction on the order in which the options can be specified. > > Indeed. It doesn't look that hard: AFAICS the problem is just that > process_sql_command() is making premature decisions about whether to > extract parameters from the SQL commands. Proposed patch attached. Great. Patch looks good to me. Best regards, -- Tatsuo Ishii SRA OSS, Inc. Japan English: http://www.sraoss.co.jp/index_en.php Japanese:http://www.sraoss.co.jp
-
Re: Confusing error message in pgbench
Fabien COELHO <coelho@cri.ensmp.fr> — 2017-08-03T09:09:50Z
>> Indeed. It doesn't look that hard: AFAICS the problem is just that >> process_sql_command() is making premature decisions about whether to >> extract parameters from the SQL commands. Proposed patch attached. > > Great. Patch looks good to me. Too me as well: code looks ok, patch applies, compiles, make check ok, manual tests with pgbench ok. That is one more patch about pgbench in the queue. -- Fabien.