summaryrefslogtreecommitdiff
path: root/test/dialect/test_postgresql.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/dialect/test_postgresql.py')
-rw-r--r--test/dialect/test_postgresql.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/dialect/test_postgresql.py b/test/dialect/test_postgresql.py
index 70730983c..4dffa0415 100644
--- a/test/dialect/test_postgresql.py
+++ b/test/dialect/test_postgresql.py
@@ -152,6 +152,28 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL):
"WHERE data > 'a' AND data < 'b''s'",
dialect=postgresql.dialect())
+ def test_create_index_with_ops(self):
+ m = MetaData()
+ tbl = Table('testtbl', m,
+ Column('data', String),
+ Column('data2', key='d2', Integer))
+
+ idx = Index('test_idx1', tbl.c.data,
+ postgresql_ops={'data': 'text_pattern_ops'})
+
+ idx2 = Index('test_idx2', tbl.c.data, tbl.c.d2,
+ postgresql_ops={'data': 'text_pattern_ops',
+ 'd2': 'int4_ops'})
+
+ self.assert_compile(schema.CreateIndex(idx),
+ 'CREATE INDEX test_idx1 ON testtbl '
+ '(data text_pattern_ops)',
+ dialect=postgresql.dialect())
+ self.assert_compile(schema.CreateIndex(idx2),
+ 'CREATE INDEX test_idx2 ON testtbl '
+ '(data text_pattern_ops, data2 int4_ops)',
+ dialect=postgresql.dialect())
+
@testing.uses_deprecated(r".*'postgres_where' argument has been "
"renamed.*")
def test_old_create_partial_index(self):