Re: pgbench post-connection command

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pgbench post-connection command
Date: 2012-01-12 16:12:09
Message-ID: CA+U5nMKfQoDmrUrQa0OeBxCBGrA2D764aLkcmVgCPiSiSb4Oqg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 12, 2012 at 3:26 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)com> 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.

It supports multiple commands via multi-statement requests
e.g.

-x "SET this = on; SET that = off"

> What would make more sense to me is to add an option for a one-time
> script, or possibly extend the script language to allow marking some
> commands as "do once".

That seems a little overcooked. Any long preparatory script can be
executed before pgbench. So this command is only for options that need
to be set on each database session. If you really do have a long
script that needs to be run for each session, you can set the command
to "SELECT execute_my_initial_function()" and then write your script
as a function.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Grittner 2012-01-12 16:16:39 Re: Remembering bug #6123
Previous Message Tom Lane 2012-01-12 16:10:32 Re: pgbench post-connection command