Re: [HACKERS] pgbench post-connection command

2012-01-13 Thread Greg Smith
There's one part of this that's still fuzzy in the spec I'd like to clarify, if nothing else than for my own memory's sake--as the person most likely to review a random pgbench patch. Simon gave an example like this: pgbench -x "SET synchronous_commit = off" All are agreed this should take

Re: [HACKERS] pgbench post-connection command

2012-01-13 Thread Simon Riggs
On Thu, Jan 12, 2012 at 8:04 PM, Tom Lane wrote: > Simon Riggs writes: >> On Thu, Jan 12, 2012 at 5:32 PM, Tom Lane wrote: >>> More like "\once ... any SQL command or meta command here ..." >>> if we want to extend the scripting language.  But I'd be perfectly happy >>> with a command-line switc

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Heikki Linnakangas
On 12.01.2012 22:04, Tom Lane wrote: Simon Riggs writes: On Thu, Jan 12, 2012 at 5:32 PM, Tom Lane wrote: More like "\once ... any SQL command or meta command here ..." if we want to extend the scripting language. But I'd be perfectly happy with a command-line switch that specifies a script

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Tom Lane
Simon Riggs writes: > On Thu, Jan 12, 2012 at 5:32 PM, Tom Lane wrote: >> More like "\once ... any SQL command or meta command here ..." >> if we want to extend the scripting language.  But I'd be perfectly happy >> with a command-line switch that specifies a script file to be run once. > Once p

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Simon Riggs
On Thu, Jan 12, 2012 at 5:32 PM, Tom Lane wrote: > More like "\once ... any SQL command or meta command here ..." > if we want to extend the scripting language.  But I'd be perfectly happy > with a command-line switch that specifies a script file to be run once. Once per connection, yes? --  S

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Tom Lane
Simon Riggs writes: > On Thu, Jan 12, 2012 at 4:24 PM, Tom Lane wrote: >> I don't believe that works for multiple \set commands, which is the >> more likely use-case for this; as noted upthread, executing SET here >> is quite unnecessary since you can get that behavior with >> "export PGOPTIONS".

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Simon Riggs
On Thu, Jan 12, 2012 at 4:24 PM, Tom Lane wrote: > Simon Riggs writes: >> On Thu, Jan 12, 2012 at 3:26 PM, Tom Lane wrote: >>> This seems rather poorly designed, mainly because there's no reason to >>> think that a single command would be sufficient. > >> It supports multiple commands via multi-

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Tom Lane
Simon Riggs writes: > On Thu, Jan 12, 2012 at 3:26 PM, Tom Lane wrote: >> This seems rather poorly designed, mainly because there's no reason to >> think that a single command would be sufficient. > It supports multiple commands via multi-statement requests > e.g. > -x "SET this = on; SET that =

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Simon Riggs
On Thu, Jan 12, 2012 at 3:26 PM, Tom Lane wrote: > Simon Riggs writes: >> New -x option for pgbench executes the given command once after >> connection of each session. > > This seems rather poorly designed, mainly because there's no reason to > think that a single command would be sufficient. I

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Tom Lane
Heikki Linnakangas writes: > On 12.01.2012 17:26, Tom Lane wrote: >> Simon Riggs writes: >>> New -x option for pgbench executes the given command once after >>> connection of each session. > If it's just for SET, you could just put the GUCs in postgresql.conf. Or use PGOPTIONS. I think there m

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Heikki Linnakangas
On 12.01.2012 17:26, Tom Lane wrote: Simon Riggs writes: New -x option for pgbench executes the given command once after connection of each session. If it's just for SET, you could just put the GUCs in postgresql.conf. This seems rather poorly designed, mainly because there's no reason to t

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Alvaro Herrera
Excerpts from Tom Lane's message of jue ene 12 12:26:49 -0300 2012: > Simon Riggs writes: > > New -x option for pgbench executes the given command once after > > connection of each session. > > This seems rather poorly designed, mainly because there's no reason to > think that a single command w

Re: [HACKERS] pgbench post-connection command

2012-01-12 Thread Tom Lane
Simon Riggs writes: > New -x option for pgbench executes the given command once after > connection of each session. This seems rather poorly designed, mainly because there's no reason to think that a single command would be sufficient. What would make more sense to me is to add an option for a o

[HACKERS] pgbench post-connection command

2012-01-12 Thread Simon Riggs
New -x option for pgbench executes the given command once after connection of each session. e.g. pgbench -x "SET synchronous_commit = off" pgbench -x "SET foo_extension.enabled = on" Allows easier testing of user parameters. Command listed in final report $ pgbench -c 2 -t 4 -x "set synchronous_