]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
- Fixed bug where index reflection would mis-interpret indkey values
authorMike Bayer <mike_mp@zzzcomputing.com>
Sun, 27 Oct 2013 22:14:44 +0000 (18:14 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sun, 27 Oct 2013 22:14:44 +0000 (18:14 -0400)
when using the pypostgresql adapter, which returns these values
as lists vs. psycopg2's return type of string.
[ticket:2855]

doc/build/changelog/changelog_08.rst
doc/build/changelog/changelog_09.rst
lib/sqlalchemy/__init__.py
lib/sqlalchemy/dialects/postgresql/base.py

index 7066916faa87a03d15ded0b0b64ef39b5c9f3115..77e70c88addb48bb6806a089fc03de3ef4ac5218 100644 (file)
@@ -7,6 +7,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
index 591a36692cd1c21e035f972a006e3c416e1c683d..27faaba1dfebd77f33d7017f3312040848585b1d 100644 (file)
@@ -9,6 +9,9 @@
 
     .. include:: changelog_07.rst
 
+.. changelog::
+    :version: 0.9.0b2
+
 .. changelog::
     :version: 0.9.0b1
     :released: October 26, 2013
index f4060325845b39cb1bcf34f23d4343ee5ca191ef..b41f3f2bcbddccc4110d90bfe9f64a7bedef4f75 100644 (file)
@@ -116,7 +116,7 @@ from .schema import (
 from .inspection import inspect
 from .engine import create_engine, engine_from_config
 
-__version__ = '0.9.0b1'
+__version__ = '0.9.0b2'
 
 def __go(lcls):
     global __all__
index 5c88ee023c9bfce95c0c2fc01a0e856428a10acb..e1dc4af7149e335c6254977fe48abf94879027ba 100644 (file)
@@ -1963,11 +1963,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