<command>\syncpipeline</command>, forcing the server to send the
results. These results can be retrieved with
<command>\getresults</command>.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-variables-pipeline-sync-count">
<term><varname>PIPELINE_SYNC_COUNT</varname></term>
<listitem>
<para>
The number of sync messages queued in an ongoing pipeline.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-variables-port">
<term><varname>PORT</varname></term>
<listitem>
<para>
The database server port to which you are currently connected.
This is set every time you connect to a database (including
program start-up), but can be changed or unset.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-variables-prompt">
<term><varname>PROMPT1</varname></term>
<term><varname>PROMPT2</varname></term>
<term><varname>PROMPT3</varname></term>
<listitem>
<para>
These specify what the prompts <application>psql</application>
issues should look like. See <xref
linkend="app-psql-prompting"/> below.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-variables-quiet">
<term><varname>QUIET</varname></term>
<listitem>
<para>
Setting this variable to <literal>on</literal> is equivalent to the command
line option <option>-q</option>. It is probably not too useful in
interactive mode.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-variables-row-count">
<term><varname>ROW_COUNT</varname></term>
<listitem>
<para>
The number of rows returned or affected by the last SQL query, or 0
if the query failed or did not report a row count.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-variables-server-version-name">
<term><varname>SERVER_VERSION_NAME</varname></term>
<term><varname>SERVER_VERSION_NUM</varname></term>
<listitem>
<para>
The server's version number as a string, for
example <literal>9.6.2</literal>, <literal>10.1</literal> or <literal>11beta1</literal>,
and in numeric form, for
example <literal>90602</literal> or <literal>100001</literal>.
These are set every time you connect to a database
(including program start-up), but can be changed or unset.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-variables-service">
<term><varname>SERVICE</varname></term>
<listitem>
<para>
The service name, if applicable.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-variables-shell-error">
<term><varname>SHELL_ERROR</varname></term>
<listitem>
<para>
<literal>true</literal> if the last shell command
failed, <literal>false</literal> if it succeeded.
This applies to shell commands invoked via the <literal>\!</literal>,
<literal>\g</literal>, <literal>\o</literal>, <literal>\w</literal>,
and <literal>\copy</literal> meta-commands, as well as backquote
(<literal>`</literal>) expansion. Note that
for <literal>\o</literal>, this variable is updated when the output
pipe is closed by the next <literal>\o</literal> command.
See also <varname>SHELL_EXIT_CODE</varname>.
</para>
</listitem>
</varlistentry>
<varlistentry id="app-psql-variables-shell-exit-code">
<term><varname>SHELL_EXIT_CODE</varname></term>
<listitem>
<para>
The exit status returned by the last shell command.
0–127 represent program exit codes, 128–255