@@ -600,13 +600,39 @@ pgbench <optional> <replaceable>options</> </optional> <replaceable>dbname</>
600
600
Variables can be set by the command-line <option>-D</> option,
601
601
explained above, or by the meta commands explained below.
602
602
In addition to any variables preset by <option>-D</> command-line options,
603
- the variable <literal>scale</> is preset to the current scale factor.
603
+ there are a few variables that are preset automatically, listed in
604
+ <xref linkend="pgbench-automatic-variables">. A value specified for these
605
+ variables using <option>-D</> takes precedence over the automatic presets.
604
606
Once set, a variable's
605
607
value can be inserted into a SQL command by writing
606
608
<literal>:</><replaceable>variablename</>. When running more than
607
609
one client session, each session has its own set of variables.
608
610
</para>
609
611
612
+ <table id="pgbench-automatic-variables">
613
+ <title>Automatic variables</title>
614
+ <tgroup cols="2">
615
+ <thead>
616
+ <row>
617
+ <entry>Variable</entry>
618
+ <entry>Description</entry>
619
+ </row>
620
+ </thead>
621
+
622
+ <tbody>
623
+ <row>
624
+ <entry> <literal>scale</literal> </entry>
625
+ <entry>current scale factor</entry>
626
+ </row>
627
+
628
+ <row>
629
+ <entry> <literal>client_id</literal> </entry>
630
+ <entry>unique number identifying the client session (starts from zero)</entry>
631
+ </row>
632
+ </tbody>
633
+ </tgroup>
634
+ </table>
635
+
610
636
<para>
611
637
Script file meta commands begin with a backslash (<literal>\</>).
612
638
Arguments to a meta command are separated by white space.