1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

Allow psql to print COPY command status in more cases.

Previously, psql would print the "COPY nnn" command status only for COPY
commands executed server-side.  Now it will print that for frontend copies
too (including \copy).  However, we continue to suppress the command status
for COPY TO STDOUT, since in that case the copy data has been routed to the
same place that the command status would go, and there is a risk of the
status line being mistaken for another line of COPY data.  Doing that would
break existing scripts, and it doesn't seem worth the benefit --- this case
seems fairly analogous to SELECT, for which we also suppress the command
status.

Kumar Rajeev Rastogi, with substantial review by Amit Khandekar
This commit is contained in:
Tom Lane
2014-03-13 13:49:03 -04:00
parent 7bae0284ee
commit f70a78bc1f
5 changed files with 82 additions and 48 deletions

View File

@@ -370,6 +370,16 @@ COPY <replaceable class="parameter">count</replaceable>
The <replaceable class="parameter">count</replaceable> is the number
of rows copied.
</para>
<note>
<para>
<application>psql</> will print this command tag only if the command
was not <literal>COPY ... TO STDOUT</>, or the
equivalent <application>psql</> meta-command
<literal>\copy ... to stdout</>. This is to prevent confusing the
command tag with the data that was just printed.
</para>
</note>
</refsect1>
<refsect1>