From ecdfc31774e226b9f57701ae197d1bcbaf6afa24 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 18 Feb 2014 18:35:23 -0500 Subject: - Support has been improved for Postgresql reflection behavior on very old (pre 8.1) versions of Postgresql, and potentially other PG engines such as Redshift (assuming Redshift reports the version as < 8.1). The query for "indexes" as well as "primary keys" relies upon inspecting a so-called "int2vector" datatype, which refuses to coerce to an array prior to 8.1 causing failures regarding the "ANY()" operator used in the query. Extensive googling has located the very hacky, but recommended-by-PG-core-developer query to use when PG version < 8.1 is in use, so index and primary key constraint reflection now work on these versions. --- test/dialect/postgresql/test_reflection.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'test/dialect/postgresql/test_reflection.py') diff --git a/test/dialect/postgresql/test_reflection.py b/test/dialect/postgresql/test_reflection.py index 705a64c8e..aefb6a0ba 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' + __only_on__ = 'postgresql > 8.2' @classmethod def setup_class(cls): @@ -128,8 +128,8 @@ class DomainReflectionTest(fixtures.TestBase, AssertsExecutionResults): class ReflectionTest(fixtures.TestBase): __only_on__ = 'postgresql' - @testing.fails_if(('postgresql', '<', (8, 4)), - "newer query is bypassed due to unsupported SQL functions") + @testing.fails_if("postgresql < 8.4", + "Better int2vector functions not available") @testing.provide_metadata def test_reflected_primary_key_order(self): meta1 = self.metadata @@ -170,6 +170,8 @@ class ReflectionTest(fixtures.TestBase): eq_( t.c.x.server_default.arg.text, "'%s'::character varying" % ("abcd" * 40) ) + + @testing.fails_if("postgresql < 8.1", "schema name leaks in, not sure") @testing.provide_metadata def test_renamed_sequence_reflection(self): metadata = self.metadata -- cgit v1.2.1