Re: pgbench post-connection command

Поиск
Список
Период
Сортировка
От Simon Riggs
Тема Re: pgbench post-connection command
Дата
Msg-id CA+U5nMKfQoDmrUrQa0OeBxCBGrA2D764aLkcmVgCPiSiSb4Oqg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: pgbench post-connection command  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: pgbench post-connection command  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Thu, Jan 12, 2012 at 3:26 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Simon Riggs <simon@2ndQuadrant.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


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: pgbench post-connection command
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Remembering bug #6123