summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Borzenkov <snaury@gmail.com>2013-07-09 23:29:58 +0400
committerDaniele Varrazzo <daniele.varrazzo@gmail.com>2014-08-21 05:35:11 +0100
commit13b0852619d005d593abd76d201143ff37ec6aa9 (patch)
tree716626a84acd05504cb646bb20aae3c1315976de
parentc81522079ee699c2ed4aba83c7d0123249bfb17e (diff)
downloadpsycopg2-13b0852619d005d593abd76d201143ff37ec6aa9.tar.gz
Allow using named with hold cursors in autocommit
-rw-r--r--psycopg/cursor_type.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c
index a475176..40dbaef 100644
--- a/psycopg/cursor_type.c
+++ b/psycopg/cursor_type.c
@@ -478,7 +478,7 @@ psyco_curs_execute(cursorObject *self, PyObject *args, PyObject *kwargs)
"can't call .execute() on named cursors more than once");
return NULL;
}
- if (self->conn->autocommit) {
+ if (self->conn->autocommit && !self->withhold) {
psyco_set_error(ProgrammingError, self,
"can't use a named cursor outside of transactions");
return NULL;