]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Added server version detection to the newly added dialect startup
authorMike Bayer <mike_mp@zzzcomputing.com>
Fri, 14 Feb 2014 19:39:41 +0000 (14:39 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 14 Feb 2014 19:39:41 +0000 (14:39 -0500)
query for  "show standard_conforming_strings"; as this variable was
added as of PG 8.2, we skip the query for PG versions older than
that as well as for backends like Redshift. #2946

doc/build/changelog/changelog_09.rst
lib/sqlalchemy/dialects/postgresql/base.py

index b57ebdc92bae69a321a9a529e3e6ed52ec6de3f7..db1079d8a67a72b0c7ae8ea791c9f303008dcf3f 100644 (file)
 .. changelog::
     :version: 0.9.3
 
+    .. change::
+        :tags: bug, postgresql
+        :tickets: 2946
+
+        Added server version detection to the newly added dialect startup
+        query for  "show standard_conforming_strings"; as this variable was
+        added as of PG 8.2, we skip the query for PG versions older than
+        that as well as for backends like Redshift.
+
     .. change::
         :tags: bug, orm, declarative
         :tickets: 2950
index 1b5927dbd177df2c8723d280d26f9fb53a90520f..4cd462a7276bc7c0cf528af0a1110b7abf4a5026 100644 (file)
@@ -1567,7 +1567,8 @@ class PGDialect(default.DefaultDialect):
         # http://www.postgresql.org/docs/9.3/static/release-9-2.html#AEN116689
         self.supports_smallserial = self.server_version_info >= (9, 2)
 
-        self._backslash_escapes = connection.scalar(
+        self._backslash_escapes = self.server_version_info < (8, 2) or \
+                    connection.scalar(
                                     "show standard_conforming_strings"
                                     ) == 'off'