summaryrefslogtreecommitdiff
path: root/test/dialect/postgresql/test_query.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_query.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_query.py')
-rw-r--r--test/dialect/postgresql/test_query.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/test/dialect/postgresql/test_query.py b/test/dialect/postgresql/test_query.py
index ee5800db0..82b49d974 100644
--- a/test/dialect/postgresql/test_query.py
+++ b/test/dialect/postgresql/test_query.py
@@ -70,6 +70,7 @@ class InsertTest(fixtures.TestBase, AssertsExecutionResults):
metadata.create_all()
self._assert_data_with_sequence(table, 'my_seq')
+ @testing.requires.returning
def test_sequence_returning_insert(self):
table = Table('testtable', metadata, Column('id', Integer,
Sequence('my_seq'), primary_key=True),
@@ -84,6 +85,7 @@ class InsertTest(fixtures.TestBase, AssertsExecutionResults):
metadata.create_all()
self._assert_data_autoincrement(table)
+ @testing.requires.returning
def test_opt_sequence_returning_insert(self):
table = Table('testtable', metadata, Column('id', Integer,
Sequence('my_seq', optional=True),
@@ -97,6 +99,7 @@ class InsertTest(fixtures.TestBase, AssertsExecutionResults):
metadata.create_all()
self._assert_data_autoincrement(table)
+ @testing.requires.returning
def test_autoincrement_returning_insert(self):
table = Table('testtable', metadata, Column('id', Integer,
primary_key=True), Column('data', String(30)))
@@ -592,8 +595,7 @@ class ServerSideCursorsTest(fixtures.TestBase, AssertsExecutionResults):
class MatchTest(fixtures.TestBase, AssertsCompiledSQL):
- __only_on__ = 'postgresql'
- __excluded_on__ = ('postgresql', '<', (8, 3, 0)),
+ __only_on__ = 'postgresql >= 8.3'
@classmethod
def setup_class(cls):