diff options
author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-10-03 14:32:01 +0300 |
---|---|---|
committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2012-10-03 14:38:22 +0300 |
commit | 7ae1815961c635fd1a6fe72acb89fdef741a45a8 (patch) | |
tree | e72e73802bc89839172130e5f9b741e3d585542f /doc/src | |
parent | bc1229c83238a0d71a3923cb48e53ea7ea37654c (diff) | |
download | postgresql-7ae1815961c635fd1a6fe72acb89fdef741a45a8.tar.gz postgresql-7ae1815961c635fd1a6fe72acb89fdef741a45a8.zip |
Return the number of rows processed when COPY is executed through SPI.
You can now get the number of rows processed by a COPY statement in a
PL/pgSQL function with "GET DIAGNOSTICS x = ROW_COUNT".
Pavel Stehule, reviewed by Amit Kapila, with some editing by me.
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/spi.sgml | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/doc/src/sgml/spi.sgml b/doc/src/sgml/spi.sgml index 7162fdb7aa3..3fe6be9bd1d 100644 --- a/doc/src/sgml/spi.sgml +++ b/doc/src/sgml/spi.sgml @@ -377,7 +377,10 @@ SPI_execute("INSERT INTO foo SELECT * FROM bar", false, 5); global pointer <literal>SPITupleTable *SPI_tuptable</literal> to access the result rows. Some utility commands (such as <command>EXPLAIN</>) also return row sets, and <literal>SPI_tuptable</> - will contain the result in these cases too. + will contain the result in these cases too. Some utility commands + (<command>COPY</>, <command>CREATE TABLE AS</>) don't return a row set, so + <literal>SPI_tuptable</> is NULL, but they still return the number of + rows processed in <varname>SPI_processed</>. </para> <para> |