From e08be44db70efda06bb8397a911908cad9e9f12d Mon Sep 17 00:00:00 2001 From: Alexey Borzenkov Date: Tue, 9 Jul 2013 23:29:58 +0400 Subject: [PATCH] Allow using named with hold cursors in autocommit --- psycopg/cursor_type.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psycopg/cursor_type.c b/psycopg/cursor_type.c index 8df1df2a..5650e437 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;