diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-27 18:14:44 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-27 18:16:42 -0400 |
commit | eb58107417d1ce956e6dfc1e4f809c8d50ba6168 (patch) | |
tree | fd1ccb31c6b8ec3f40ac6ab192e8b04a5fa98700 | |
parent | 64e32bda528fd34b264c4e6cd8b3369e9e0bc8ee (diff) | |
download | sqlalchemy-eb58107417d1ce956e6dfc1e4f809c8d50ba6168.tar.gz |
- Fixed bug where index reflection would mis-interpret indkey values
when using the pypostgresql adapter, which returns these values
as lists vs. psycopg2's return type of string.
[ticket:2855]
Conflicts:
doc/build/changelog/changelog_09.rst
lib/sqlalchemy/__init__.py
-rw-r--r-- | doc/build/changelog/changelog_08.rst | 12 | ||||
-rw-r--r-- | lib/sqlalchemy/__init__.py | 2 | ||||
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 5 |
3 files changed, 17 insertions, 2 deletions
diff --git a/doc/build/changelog/changelog_08.rst b/doc/build/changelog/changelog_08.rst index f5becb6c3..c859f8260 100644 --- a/doc/build/changelog/changelog_08.rst +++ b/doc/build/changelog/changelog_08.rst @@ -8,6 +8,18 @@ .. include:: changelog_07.rst .. changelog:: + :version: 0.8.4 + + .. change:: + :tags: bug, postgresql + :tickets: 2855 + :versions: 0.9.0b2 + + Fixed bug where index reflection would mis-interpret indkey values + when using the pypostgresql adapter, which returns these values + as lists vs. psycopg2's return type of string. + +.. changelog:: :version: 0.8.3 :released: October 26, 2013 diff --git a/lib/sqlalchemy/__init__.py b/lib/sqlalchemy/__init__.py index 0c02ac2a1..55a5a2b10 100644 --- a/lib/sqlalchemy/__init__.py +++ b/lib/sqlalchemy/__init__.py @@ -120,7 +120,7 @@ from .engine import create_engine, engine_from_config __all__ = sorted(name for name, obj in locals().items() if not (name.startswith('_') or _inspect.ismodule(obj))) -__version__ = '0.8.3' +__version__ = '0.8.4' del _inspect, sys diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index a20cca702..1aaafac39 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1929,11 +1929,14 @@ class PGDialect(default.DefaultDialect): table_oid = self.get_table_oid(connection, table_name, schema, info_cache=kw.get('info_cache')) + # cast indkey as varchar since it's an int2vector, + # returned as a list by some drivers such as pypostgresql + IDX_SQL = """ SELECT i.relname as relname, ix.indisunique, ix.indexprs, ix.indpred, - a.attname, a.attnum, ix.indkey + a.attname, a.attnum, ix.indkey::varchar FROM pg_class t join pg_index ix on t.oid = ix.indrelid |