From 0f48e0675134eccd905eaf696a03c1e8cc85eab4 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Mon, 16 Apr 2012 11:30:32 +0300 Subject: 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. --- doc/src/sgml/plpython.sgml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'doc/src') 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) foo = rv[i]["my_column"] + The number of rows returned can be obtained using the built-in + len function. @@ -912,7 +914,10 @@ foo = rv[i]["my_column"] nrows() - 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 UPDATE command will set this value but + won't return any rows (unless RETURNING is used). -- cgit v1.2.3