Re: pgbench: new feature allowing to launch shell commands

From: Takahiro Itagaki <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
To: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: pgbench: new feature allowing to launch shell commands
Date: 2009-12-10 08:21:44
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

> Michael Paquier <michael(dot)paquier(at)gmail(dot)com> wrote:
> > Please find attached the latest version of the patch,
> > with the threading bug corrected and the documentation updated as well.

Please don't describe your-specific usage of shell command in the documentation

> Why do you use BUFFER_SIZE-1 for snprintf?
> snprintf(commandShell, SHELL_COMMAND_SIZE-1, ...)
> Trailing nulls are also included in the length, so
> snprintf(commandShell, SHELL_COMMAND_SIZE, ...)
> would be ok. (removed -1)

I found several bugs and matters.
* The calcuration of the shell command length is wrong.
* You cannot assign 0 to variables with \setshell meta command.
* Comparison with "== true" is a bad manner.
* You called \shell "shell command" and \setsell "shell script",
but we don't need the difference. I think "shell command" is enough.

Heavily cleaned up patch attached. Please review it.

Takahiro Itagaki
NTT Open Source Software Center

Attachment Content-Type Size
pgbenchshell_20091210.patch application/octet-stream 6.8 KB

In response to


Browse pgsql-hackers by date

  From Date Subject
Next Message marcin mank 2009-12-10 08:44:06 Re: bug: fuzzystrmatch levenshtein is wrong
Previous Message Pavel Stehule 2009-12-10 07:06:00 Re: explain output infelicity in psql