diff options
Diffstat (limited to 'test/dialect/postgresql/test_compiler.py')
-rw-r--r-- | test/dialect/postgresql/test_compiler.py | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/test/dialect/postgresql/test_compiler.py b/test/dialect/postgresql/test_compiler.py index 080cfb767..e8bead008 100644 --- a/test/dialect/postgresql/test_compiler.py +++ b/test/dialect/postgresql/test_compiler.py @@ -1034,7 +1034,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): tbl.append_constraint(cons) self.assert_compile( schema.AddConstraint(cons), - "ALTER TABLE testtbl ADD EXCLUDE USING gist " "(room WITH =)", + "ALTER TABLE testtbl ADD EXCLUDE USING gist (room WITH =)", dialect=postgresql.dialect(), ) @@ -1134,7 +1134,7 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): tbl.append_constraint(cons_copy) self.assert_compile( schema.AddConstraint(cons_copy), - "ALTER TABLE testtbl ADD EXCLUDE USING gist " "(room WITH =)", + "ALTER TABLE testtbl ADD EXCLUDE USING gist (room WITH =)", ) def test_exclude_constraint_copy_where_using(self): @@ -1243,6 +1243,21 @@ class CompileTest(fixtures.TestBase, AssertsCompiledSQL): dialect=postgresql.dialect(), ) + def test_exclude_constraint_literal_binds(self): + m = MetaData() + tbl = Table("foo", m, Column("x", Integer), Column("y", Integer)) + cons = ExcludeConstraint( + (func.power(tbl.c.x, 42), "="), + (func.int8range(column("x"), "y"), "&&"), + ) + tbl.append_constraint(cons) + self.assert_compile( + schema.AddConstraint(cons), + "ALTER TABLE foo ADD EXCLUDE USING gist " + "(power(x, 42) WITH =, int8range(x, 'y') WITH &&)", + dialect=postgresql.dialect(), + ) + def test_substring(self): self.assert_compile( func.substring("abc", 1, 2), |