Re: [Sqlalchemy-tickets] [sqlalchemy] #2946: standard_conforming_strings prior to PG 8.2 (was: Reds
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2014-02-08 18:22:58
|
#2946: standard_conforming_strings prior to PG 8.2
----------------------------------+-----------------------------------
Reporter: KyleJamesWalker | Owner: zzzeek
Type: defect | Status: new
Priority: medium | Milestone: 0.9.3
Component: postgres | Severity: trivial - <10 minutes
Resolution: | Keywords:
Progress State: in queue |
----------------------------------+-----------------------------------
Changes (by zzzeek):
* severity: no triage selected yet => trivial - <10 minutes
* status_field: awaiting triage => in queue
* milestone: => 0.9.3
Comment:
here's a patch, can't commit it bc bitbucket is down:
{{{
#!python
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py
b/lib/sqlalchemy/dialects/postgresql/base.py
index 29584d1..43e77d5 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'
}}}
but also, for redshift can you please use:
https://pypi.python.org/pypi/redshift-sqlalchemy
it's listed here in the docs:
http://docs.sqlalchemy.org/en/rel_0_9/dialects/index.html#external-
dialects
redshift is not exactly postgresql in any case so the project there is
maintaining compatibility.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2946#comment:1>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|