From: Mike Bayer Date: Tue, 25 Mar 2014 16:26:42 +0000 (-0400) Subject: - Fixed regression caused by release 0.8.5 / 0.9.3's compatibility X-Git-Tag: rel_0_9_4~26 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1a35188b6903a48999ebbd1aeeec0114d3cbe7d3;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git - Fixed regression caused by release 0.8.5 / 0.9.3's compatibility enhancements where index reflection on Postgresql versions specific to only the 8.1, 8.2 series again broke, surrounding the ever problematic int2vector type. While int2vector supports array operations as of 8.1, apparently it only supports CAST to a varchar as of 8.3. fix #3000 --- diff --git a/doc/build/changelog/changelog_08.rst b/doc/build/changelog/changelog_08.rst index 7616a3f107..2b0fe2c39b 100644 --- a/doc/build/changelog/changelog_08.rst +++ b/doc/build/changelog/changelog_08.rst @@ -11,6 +11,18 @@ .. changelog:: :version: 0.8.6 + .. change:: + :tags: bug, postgresql + :tickets: 3000 + :versions: 0.9.4 + + Fixed regression caused by release 0.8.5 / 0.9.3's compatibility + enhancements where index reflection on Postgresql versions specific + to only the 8.1, 8.2 series again + broke, surrounding the ever problematic int2vector type. While + int2vector supports array operations as of 8.1, apparently it only + supports CAST to a varchar as of 8.3. + .. change:: :tags: bug, orm :tickets: 2995, diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index cea9d67b69..f69a6e0108 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -2204,7 +2204,10 @@ class PGDialect(default.DefaultDialect): t.relname, i.relname """ % ( - "::varchar" if self.server_version_info >= (8, 1) else "", + # version 8.3 here was based on observing the + # 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 "", self._pg_index_any("a.attnum", "ix.indkey") ) diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index aefb6a0ba3..01e14ffa0f 100644 --- a/test/dialect/postgresql/test_reflection.py +++ b/test/dialect/postgresql/test_reflection.py @@ -20,7 +20,7 @@ class DomainReflectionTest(fixtures.TestBase, AssertsExecutionResults): """Test PostgreSQL domains""" - __only_on__ = 'postgresql > 8.2' + __only_on__ = 'postgresql > 8.3' @classmethod def setup_class(cls):