From: Mike Bayer Date: Tue, 17 Jun 2008 15:12:56 +0000 (+0000) Subject: - Repaired server_side_cursors to properly detect X-Git-Tag: rel_0_4_7~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=456bdfe920ebd048afed7a254bd01c4c87804dc5;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Repaired server_side_cursors to properly detect text() clauses. --- diff --git a/CHANGES b/CHANGES index 7f9d208b9e..3e53e00bce 100644 --- a/CHANGES +++ b/CHANGES @@ -21,6 +21,10 @@ CHANGES Totally unrelated types, or subtypes not set up with mapper inheritance against the target mapper are still not allowed. + +- postgres + - Repaired server_side_cursors to properly detect + text() clauses. - mysql - Added 'CALL' to the list of SQL keywords which return diff --git a/lib/sqlalchemy/databases/postgres.py b/lib/sqlalchemy/databases/postgres.py index 605ce7272b..212daa06da 100644 --- a/lib/sqlalchemy/databases/postgres.py +++ b/lib/sqlalchemy/databases/postgres.py @@ -272,7 +272,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: