Re: pgbench post-connection command

Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>

From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Simon Riggs <simon@2ndQuadrant.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2012-01-12T15:51:56Z
Lists: pgsql-hackers
On 12.01.2012 17:26, Tom Lane wrote:
> Simon Riggs<simon@2ndQuadrant.com>  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
> think that a single command would be sufficient.
>
> 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".

Hmm, that might be handy. I wanted to write a some tests a while ago 
where each session operated on a separate table. With this, I could've 
put the CREATE TABLE statement in the statup-script.

-- 
   Heikki Linnakangas
   EnterpriseDB   http://www.enterprisedb.com