1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-25 01:02:05 +03:00

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.
This commit is contained in:
Peter Eisentraut
2012-04-16 11:30:32 +03:00
parent c03523ed3f
commit 0f48e06751
3 changed files with 86 additions and 1 deletions

View File

@ -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>