Re: [PATCH] pgbench: new feature allowing to launch shell commands - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: [PATCH] pgbench: new feature allowing to launch shell commands
Date
Msg-id c64c5f8b0910252350w42f7ea13g52a6a88a86143374@mail.gmail.com
Whole thread Raw
In response to Re: [PATCH] pgbench: new feature allowing to launch shell commands  (Greg Smith <gsmith@gregsmith.com>)
List pgsql-hackers
 
I see this in pgbench.c:

 /* return false iff client should be disconnected */
 static bool
 doCustom(CState *st, instr_time *conn_time)

I think you need to increase the verbosity of the error messages when you're working on this code, because when I compile I get a slew of these errors pointing to the problem too:
pgbench.c:1009: warning: return with no value, in function returning non-void
The fix is that when there's an error, you need to do this:

   return clientDone(st, false);
Thanks for the tip. In fact I based my patch on postgres 8.4.1 and not on the head of the git repository.
This explains why I did not go through the error messages returned by doCustom.
The new version of the patch attached to this email has been made directly from the git repository. It looks definitely cleaner this time.
 
I tried to clean the patch so as to pass the rest of the command line also, so as not to have to do it later.
A short update of the setshell feature is also available on PostgreSQL's wiki at the page pgbench shell command.
 
About the potential examples, I can also write a short script and put that on the wiki.
As you said previously, the Pareto example is possible, but also why not thinking about other statistical distributions? a Gaussian or a Poisson distribution? There are many possibilities.

Regards,

--
Michael Paquier

NTT OSSC
Attachment

pgsql-hackers by date:

Previous
From: Christophe Pettus
Date:
Subject: Proposal: String key space for advisory locks
Next
From: Itagaki Takahiro
Date:
Subject: Re: Proposal: String key space for advisory locks