diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-14 14:39:41 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-02-14 14:39:41 -0500 |
commit | 28229a35e0231e770679ce48436f7e31723ac159 (patch) | |
tree | dc4ab4ab6574c1099e64a57b29560aac038beaec /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | 5330c02b729782c2774bc4b956ccd2b4ca134eb4 (diff) | |
download | sqlalchemy-28229a35e0231e770679ce48436f7e31723ac159.tar.gz |
- 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
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 1b5927dbd..4cd462a72 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -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' |