]> 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:16:42 +0000 (18:16 -0400)
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

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

index f5becb6c3a31be3ab0ec1b6f180319eebfe5f8cb..c859f826005e06bcb4e7750784c291c48710c16b 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 0c02ac2a10fc11c76aa639e74975d580e46d6542..55a5a2b1030f0489c8c1f50430f3a626ed16eade 100644 (file)
@@ -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
 
index a20cca702e4a972a0584b69e4d5207951c374e7b..1aaafac3963664950cb03efc960232855a669b78 100644 (file)
@@ -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