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

Make the COPY command return a command tag that includes the number of

rows copied.  Backend side of Volkan Yazici's recent patch, with
corrections and documentation.
This commit is contained in:
Tom Lane
2006-03-03 19:54:10 +00:00
parent 4e086f7cb5
commit 023570f5e3
5 changed files with 55 additions and 10 deletions

View File

@ -1,4 +1,4 @@
<!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.63 2006/01/18 06:49:25 neilc Exp $ -->
<!-- $PostgreSQL: pgsql/doc/src/sgml/protocol.sgml,v 1.64 2006/03/03 19:54:09 tgl Exp $ -->
<chapter id="protocol">
<title>Frontend/Backend Protocol</title>
@ -2069,7 +2069,7 @@ CommandComplete (B)
String
</term>
<listitem>
<para>
<para>
The command tag. This is usually a single
word that identifies which SQL command was completed.
</para>
@ -2109,7 +2109,16 @@ CommandComplete (B)
<literal>FETCH <replaceable>rows</replaceable></literal> where
<replaceable>rows</replaceable> is the number of rows that
have been retrieved from the cursor.
</para>
</para>
<para>
For a <command>COPY</command> command, the tag is
<literal>COPY <replaceable>rows</replaceable></literal> where
<replaceable>rows</replaceable> is the number of rows copied.
(Note: the row count appears only in
<productname>PostgreSQL</productname> 8.2 and later.)
</para>
</listitem>
</varlistentry>
</variablelist>

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/copy.sgml,v 1.72 2005/12/28 14:38:32 momjian Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/copy.sgml,v 1.73 2006/03/03 19:54:10 tgl Exp $
PostgreSQL documentation
-->
@ -253,6 +253,20 @@ COPY <replaceable class="parameter">tablename</replaceable> [ ( <replaceable cla
</variablelist>
</refsect1>
<refsect1>
<title>Outputs</title>
<para>
On successful completion, a <command>COPY</> command returns a command
tag of the form
<screen>
COPY <replaceable class="parameter">count</replaceable>
</screen>
The <replaceable class="parameter">count</replaceable> is the number
of rows inserted into or copied from the table.
</para>
</refsect1>
<refsect1>
<title>Notes</title>