@@ -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>
@@ -3570,10 +3563,6 @@ select 1\; select 2\; select 3;
3570
3563
commands included in the string to divide it into multiple
3571
3564
transactions. (See <xref linkend="protocol-flow-multi-statement"/>
3572
3565
for more details about how the server handles multi-query strings.)
3573
- <application>psql</application> prints only the last query result
3574
- it receives for each request; in this example, although all
3575
- three <command>SELECT</command>s are indeed executed, <application>psql</application>
3576
- only prints the <literal>3</literal>.
3577
3566
</para>
3578
3567
</listitem>
3579
3568
</varlistentry>
@@ -4160,6 +4149,18 @@ bar
4160
4149
</varlistentry>
4161
4150
4162
4151
<varlistentry>
4152
+ <term><varname>SHOW_ALL_RESULTS</varname></term>
4153
+ <listitem>
4154
+ <para>
4155
+ When this variable is set to <literal>off</literal>, only the last
4156
+ result of a combined query (<literal>\;</literal>) is shown instead of
4157
+ all of them. The default is <literal>on</literal>. The off behavior
4158
+ is for compatibility with older versions of psql.
4159
+ </para>
4160
+ </listitem>
4161
+ </varlistentry>
4162
+
4163
+ <varlistentry>
4163
4164
<term><varname>SHOW_CONTEXT</varname></term>
4164
4165
<listitem>
4165
4166
<para>
0 commit comments