From be818baf28aac68fbb7934881b4539cb08e9aaa2 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 17 Jun 2008 15:15:16 +0000 Subject: merged r4857, postgres server_side_cursors fix, from 0.4 branch --- lib/sqlalchemy/databases/postgres.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/databases/postgres.py') diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 2f4865e96..124242086 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -278,7 +278,10 @@ class PGExecutionContext(default.DefaultExecutionContext): self.dialect.server_side_cursors and \ ((self.compiled and isinstance(self.compiled.statement, expression.Selectable)) \ or \ - (not self.compiled and self.statement and SERVER_SIDE_CURSOR_RE.match(self.statement))) + ( + (not self.compiled or isinstance(self.compiled.statement, expression._TextClause)) + and self.statement and SERVER_SIDE_CURSOR_RE.match(self.statement)) + ) if self.__is_server_side: # use server-side cursors: -- cgit v1.2.1