summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-03-28 10:37:04 +0100
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2017-03-28 10:37:04 +0100
commit3b48918bef71162c05da9c16962ef79cab2df31a (patch)
tree7b0b278500e7664853b219cca97e2ef8670d6fc8 /lib
parentadf55babe8ef3b7c957b54eef174f64527997549 (diff)
downloadpsycopg2-3b48918bef71162c05da9c16962ef79cab2df31a.tar.gz
Note that the fast executemany functions don't respect rowcount
See issue #540
Diffstat (limited to 'lib')
-rw-r--r--lib/extras.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/extras.py b/lib/extras.py
index 9e16165..69c7f32 100644
--- a/lib/extras.py
+++ b/lib/extras.py
@@ -1178,6 +1178,9 @@ def execute_batch(cur, sql, argslist, page_size=100):
fewer multi-statement commands, each one containing at most *page_size*
statements, resulting in a reduced number of server roundtrips.
+ After the execution of the functtion the `cursor.rowcount` property will
+ **not** contain a total result.
+
"""
for page in _paginate(argslist, page_size=page_size):
sqls = [cur.mogrify(sql, args) for args in page]
@@ -1212,6 +1215,9 @@ def execute_values(cur, sql, argslist, template=None, page_size=100):
.. __: https://www.postgresql.org/docs/current/static/queries-values.html
+ After the execution of the functtion the `cursor.rowcount` property will
+ **not** contain a total result.
+
While :sql:`INSERT` is an obvious candidate for this function it is
possible to use it with other statements, for example::