aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2013-06-14 23:31:44 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2013-06-14 23:31:44 +0300
commitb23160889c963dfe23d8cf1f9be64fb3c535a2d6 (patch)
treefc942b60c7d6a7797771e79dd83440704a2ebb02 /doc/src
parent46e1434f3db21cdc05dea42b4e060d2078ff5b87 (diff)
downloadpostgresql-b23160889c963dfe23d8cf1f9be64fb3c535a2d6.tar.gz
postgresql-b23160889c963dfe23d8cf1f9be64fb3c535a2d6.zip
Add :client_id automatic variable for custom pgbench scripts.
This makes it easier to write custom scripts that have different logic for each client. Gurjeet Singh, with some changes by me.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/pgbench.sgml28
1 files changed, 27 insertions, 1 deletions
diff --git a/doc/src/sgml/pgbench.sgml b/doc/src/sgml/pgbench.sgml
index e9900d32670..8775606affa 100644
--- a/doc/src/sgml/pgbench.sgml
+++ b/doc/src/sgml/pgbench.sgml
@@ -600,13 +600,39 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
Variables can be set by the command-line <option>-D</> option,
explained above, or by the meta commands explained below.
In addition to any variables preset by <option>-D</> command-line options,
- the variable <literal>scale</> is preset to the current scale factor.
+ there are a few variables that are preset automatically, listed in
+ <xref linkend="pgbench-automatic-variables">. A value specified for these
+ variables using <option>-D</> takes precedence over the automatic presets.
Once set, a variable's
value can be inserted into a SQL command by writing
<literal>:</><replaceable>variablename</>. When running more than
one client session, each session has its own set of variables.
</para>
+ <table id="pgbench-automatic-variables">
+ <title>Automatic variables</title>
+ <tgroup cols="2">
+ <thead>
+ <row>
+ <entry>Variable</entry>
+ <entry>Description</entry>
+ </row>
+ </thead>
+
+ <tbody>
+ <row>
+ <entry> <literal>scale</literal> </entry>
+ <entry>current scale factor</entry>
+ </row>
+
+ <row>
+ <entry> <literal>client_id</literal> </entry>
+ <entry>unique number identifying the client session (starts from zero)</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
<para>
Script file meta commands begin with a backslash (<literal>\</>).
Arguments to a meta command are separated by white space.