summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_reflection.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2014-02-18 18:35:23 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2014-02-18 18:35:23 -0500
commitecdfc31774e226b9f57701ae197d1bcbaf6afa24 (patch)
treebe2b51199ebef39ee4a26e47c6b8b77e0388843e /test/dialect/postgresql/test_reflection.py
parentfdedb69d9c6d995fc85105c22f0f537ea25a0c44 (diff)
downloadsqlalchemy-ecdfc31774e226b9f57701ae197d1bcbaf6afa24.tar.gz
- 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.
Diffstat (limited to 'test/dialect/postgresql/test_reflection.py')
-rw-r--r--test/dialect/postgresql/test_reflection.py8
1 files changed, 5 insertions, 3 deletions
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