summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;