diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2021-04-15 19:41:42 +0200 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2021-04-15 19:42:55 +0200 |
commit | fae65629cec824738ee11bf60f757239906d64fa (patch) | |
tree | 9430fa034187059c6fa5f971bf3c6aa915e0ecc7 /doc/src | |
parent | e2e2efca85b4857361780ed0c736c2a44edb458a (diff) | |
download | postgresql-fae65629cec824738ee11bf60f757239906d64fa.tar.gz postgresql-fae65629cec824738ee11bf60f757239906d64fa.zip |
Revert "psql: Show all query results by default"
This reverts commit 3a5130672296ed4e682403a77a9a3ad3d21cef75.
Per discussion, this patch had too many issues to resolve at this
point of the development cycle. We'll try again in the future.
Discussion: https://www.postgresql.org/message-id/flat/alpine.DEB.2.21.1904132231510.8961@lancre
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/ref/psql-ref.sgml | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 67e527124d9..bd4f26e6cc8 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -127,11 +127,18 @@ echo '\x \\ SELECT * FROM foo;' | psql commands included in the string to divide it into multiple transactions. (See <xref linkend="protocol-flow-multi-statement"/> for more details about how the server handles multi-query strings.) + Also, <application>psql</application> only prints the + result of the last <acronym>SQL</acronym> command in the string. + This is different from the behavior when the same string is read from + a file or fed to <application>psql</application>'s standard input, + because then <application>psql</application> sends + each <acronym>SQL</acronym> command separately. </para> <para> - If having several commands executed in one transaction is not desired, - use repeated <option>-c</option> commands or feed multiple commands to - <application>psql</application>'s standard input, + Because of this behavior, putting more than one SQL command in a + single <option>-c</option> string often has unexpected results. + It's better to use repeated <option>-c</option> commands or feed + multiple commands to <application>psql</application>'s standard input, either using <application>echo</application> as illustrated above, or via a shell here-document, for example: <programlisting> @@ -3525,6 +3532,10 @@ select 1\; select 2\; select 3; commands included in the string to divide it into multiple transactions. (See <xref linkend="protocol-flow-multi-statement"/> for more details about how the server handles multi-query strings.) + <application>psql</application> prints only the last query result + it receives for each request; in this example, although all + three <command>SELECT</command>s are indeed executed, <application>psql</application> + only prints the <literal>3</literal>. </para> </listitem> </varlistentry> @@ -4111,18 +4122,6 @@ bar </varlistentry> <varlistentry> - <term><varname>SHOW_ALL_RESULTS</varname></term> - <listitem> - <para> - When this variable is set to <literal>off</literal>, only the last - result of a combined query (<literal>\;</literal>) is shown instead of - all of them. The default is <literal>on</literal>. The off behavior - is for compatibility with older versions of psql. - </para> - </listitem> - </varlistentry> - - <varlistentry> <term><varname>SHOW_CONTEXT</varname></term> <listitem> <para> |