From 13b0852619d005d593abd76d201143ff37ec6aa9 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 a4751760..40dbaef0 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;