]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
merged r4857, postgres server_side_cursors fix, from 0.4 branch
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 17 Jun 2008 15:15:16 +0000 (15:15 +0000)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 17 Jun 2008 15:15:16 +0000 (15:15 +0000)
CHANGES
lib/sqlalchemy/databases/postgres.py

diff --git a/CHANGES b/CHANGES
index 5441a147076ecc725ae9d55bba3c06ba2728cffa..377690e55d9c3a5174b49c36c65f966f7862fbf4 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -83,6 +83,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
index 2f4865e96e96d83ac8b1a7889197802f8e5c6e30..12424208640ef3625543255b49d824f35b66ac77 100644 (file)
@@ -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: