Commits

Mike Bayer committed a652f09

- Repaired server_side_cursors to properly detect
text() clauses.

Comments (0)

Files changed (2)

       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

lib/sqlalchemy/databases/postgres.py

             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: