1. Mike Bayer
  2. sqlalchemy

Commits

Mike Bayer  committed 28229a3

- 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. #2946

  • Participants
  • Parent commits 5330c02
  • Branches master

Comments (0)

Files changed (2)

File doc/build/changelog/changelog_09.rst

View file
  • Ignore whitespace
     :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
 

File lib/sqlalchemy/dialects/postgresql/base.py

View file
  • Ignore whitespace
         # 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'