}
}
+ /*
+ * Define a :client_id variable that is unique per connection. But don't
+ * override an explicit -D switch.
+ */
+ if (getVariable(&state[0], "client_id") == NULL)
+ {
+ for (i = 0; i < nclients; i++)
+ {
+ snprintf(val, sizeof(val), "%d", i);
+ if (!putVariable(&state[i], "startup", "client_id", val))
+ exit(1);
+ }
+ }
+
if (!is_no_vacuum)
{
fprintf(stderr, "starting vacuum...");
Variables can be set by the command-line
explained above, or by the meta commands explained below.
In addition to any variables preset by
- the variable scale> is preset to the current scale factor.
+ there are a few variables that are preset automatically, listed in
+ . A value specified for these
+ variables using
Once set, a variable's
value can be inserted into a SQL command by writing
:>variablename>. When running more than
one client session, each session has its own set of variables.
+
+
Automatic variables
+
+
+ |
+ Variable
+ Description
+
+
+
+
+ |
+ scale
+ current scale factor
+
+
+ |
+ client_id
+ unique number identifying the client session (starts from zero)
+
+
+
+
+
Script file meta commands begin with a backslash (\>).
Arguments to a meta command are separated by white space.