diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-07-24 12:24:18 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2015-07-24 12:24:18 -0400 |
commit | 9e092e339463e6c6e02cf85266ca49ab1c32832f (patch) | |
tree | 28ab48e3d5de7c9c76445c8c7a2aad5e83a591b2 /lib/sqlalchemy/dialects/postgresql/base.py | |
parent | 552f1f135f66a1a3b9a1a8c3d5e1e6431e4fd234 (diff) | |
download | sqlalchemy-9e092e339463e6c6e02cf85266ca49ab1c32832f.tar.gz |
- An adjustment to the new Postgresql feature of reflecting storage
options and USING of :ticket:`3455` released in 1.0.6,
to disable the feature for Postgresql versions < 8.2 where the
``reloptions`` column is not provided; this allows Amazon Redshift
to again work as it is based on an 8.0.x version of Postgresql.
Fix courtesy Pete Hollobon.
references #3455
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index dc7987d74..64d19eda1 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -2641,7 +2641,7 @@ class PGDialect(default.DefaultDialect): i.relname as relname, ix.indisunique, ix.indexprs, ix.indpred, a.attname, a.attnum, NULL, ix.indkey%s, - i.reloptions, am.amname + %s, am.amname FROM pg_class t join pg_index ix on t.oid = ix.indrelid @@ -2664,6 +2664,8 @@ class PGDialect(default.DefaultDialect): # cast does not work in PG 8.2.4, does work in 8.3.0. # nothing in PG changelogs regarding this. "::varchar" if self.server_version_info >= (8, 3) else "", + "i.reloptions" if self.server_version_info >= (8, 2) + else "NULL", self._pg_index_any("a.attnum", "ix.indkey") ) else: |