diff options
author | Alexey Borzenkov <snaury@gmail.com> | 2013-07-09 23:29:58 +0400 |
---|---|---|
committer | Daniele Varrazzo <daniele.varrazzo@gmail.com> | 2014-08-21 05:35:11 +0100 |
commit | 13b0852619d005d593abd76d201143ff37ec6aa9 (patch) | |
tree | 716626a84acd05504cb646bb20aae3c1315976de | |
parent | c81522079ee699c2ed4aba83c7d0123249bfb17e (diff) | |
download | psycopg2-13b0852619d005d593abd76d201143ff37ec6aa9.tar.gz |
Allow using named with hold cursors in autocommit
-rw-r--r-- | psycopg/cursor_type.c | 2 |
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; |