aboutsummaryrefslogtreecommitdiff
path: root/doc/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2012-04-16 11:30:32 +0300
committerPeter Eisentraut <peter_e@gmx.net>2012-04-16 11:30:32 +0300
commit0f48e0675134eccd905eaf696a03c1e8cc85eab4 (patch)
tree5a93e2e1b711d3e6b8e5cb0956049649fa92ed1b /doc/src
parentc03523ed3fc65e219068aff536330ce451f63ca7 (diff)
downloadpostgresql-0f48e0675134eccd905eaf696a03c1e8cc85eab4.tar.gz
postgresql-0f48e0675134eccd905eaf696a03c1e8cc85eab4.zip
PL/Python: Improve documentation of nrows() method
Clarify that nrows() is the number of rows processed, versus the number of rows returned, which can be obtained using len. Also add tests about that.
Diffstat (limited to 'doc/src')
-rw-r--r--doc/src/sgml/plpython.sgml7
1 files changed, 6 insertions, 1 deletions
diff --git a/doc/src/sgml/plpython.sgml b/doc/src/sgml/plpython.sgml
index a39438836fd..cc5c7efbe00 100644
--- a/doc/src/sgml/plpython.sgml
+++ b/doc/src/sgml/plpython.sgml
@@ -903,6 +903,8 @@ rv = plpy.execute("SELECT * FROM my_table", 5)
<programlisting>
foo = rv[i]["my_column"]
</programlisting>
+ The number of rows returned can be obtained using the built-in
+ <function>len</function> function.
</para>
<para>
@@ -912,7 +914,10 @@ foo = rv[i]["my_column"]
<term><literal><function>nrows</function>()</literal></term>
<listitem>
<para>
- Returns the number of rows returned or processed by the query.
+ Returns the number of rows processed by the command. Note that this
+ is not necessarily the same as the number of rows returned. For
+ example, an <command>UPDATE</command> command will set this value but
+ won't return any rows (unless <literal>RETURNING</literal> is used).
</para>
</listitem>
</varlistentry>