@@ -127,18 +127,11 @@ echo '\x \\ SELECT * FROM foo;' | psql
127
127
commands included in the string to divide it into multiple
128
128
transactions. (See <xref linkend="protocol-flow-multi-statement"/>
129
129
for more details about how the server handles multi-query strings.)
130
- Also, <application>psql</application> only prints the
131
- result of the last <acronym>SQL</acronym> command in the string.
132
- This is different from the behavior when the same string is read from
133
- a file or fed to <application>psql</application>'s standard input,
134
- because then <application>psql</application> sends
135
- each <acronym>SQL</acronym> command separately.
136
130
</para>
137
131
<para>
138
- Because of this behavior, putting more than one SQL command in a
139
- single <option>-c</option> string often has unexpected results.
140
- It's better to use repeated <option>-c</option> commands or feed
141
- multiple commands to <application>psql</application>'s standard input,
132
+ If having several commands executed in one transaction is not desired,
133
+ use repeated <option>-c</option> commands or feed multiple commands to
134
+ <application>psql</application>'s standard input,
142
135
either using <application>echo</application> as illustrated above, or
143
136
via a shell here-document, for example:
144
137
<programlisting>
@@ -3527,10 +3520,6 @@ select 1\; select 2\; select 3;
3527
3520
commands included in the string to divide it into multiple
3528
3521
transactions. (See <xref linkend="protocol-flow-multi-statement"/>
3529
3522
for more details about how the server handles multi-query strings.)
3530
- <application>psql</application> prints only the last query result
3531
- it receives for each request; in this example, although all
3532
- three <command>SELECT</command>s are indeed executed, <application>psql</application>
3533
- only prints the <literal>3</literal>.
3534
3523
</para>
3535
3524
</listitem>
3536
3525
</varlistentry>
@@ -4117,6 +4106,18 @@ bar
4117
4106
</varlistentry>
4118
4107
4119
4108
<varlistentry>
4109
+ <term><varname>SHOW_ALL_RESULTS</varname></term>
4110
+ <listitem>
4111
+ <para>
4112
+ When this variable is set to <literal>off</literal>, only the last
4113
+ result of a combined query (<literal>\;</literal>) is shown instead of
4114
+ all of them. The default is <literal>on</literal>. The off behavior
4115
+ is for compatibility with older versions of psql.
4116
+ </para>
4117
+ </listitem>
4118
+ </varlistentry>
4119
+
4120
+ <varlistentry>
4120
4121
<term><varname>SHOW_CONTEXT</varname></term>
4121
4122
<listitem>
4122
4123
<para>
0 commit comments