summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py3
-rw-r--r--lib/sqlalchemy/dialects/postgresql/ext.py15
2 files changed, 9 insertions, 9 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 255c72042..3ba103802 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -2350,8 +2350,9 @@ class PGDDLCompiler(compiler.DDLCompiler):
constraint
)
elements = []
+ kw["include_table"] = False
+ kw["literal_binds"] = True
for expr, name, op in constraint._render_exprs:
- kw["include_table"] = False
exclude_element = self.sql_compiler.process(expr, **kw) + (
(" " + constraint.ops[expr.key])
if hasattr(expr, "key") and expr.key in constraint.ops
diff --git a/lib/sqlalchemy/dialects/postgresql/ext.py b/lib/sqlalchemy/dialects/postgresql/ext.py
index 0f5efb1de..22604955d 100644
--- a/lib/sqlalchemy/dialects/postgresql/ext.py
+++ b/lib/sqlalchemy/dialects/postgresql/ext.py
@@ -164,16 +164,15 @@ class ExcludeConstraint(ColumnCollectionConstraint):
:param \*elements:
A sequence of two tuples of the form ``(column, operator)`` where
- "column" is a SQL expression element or a raw SQL string, most
- typically a :class:`_schema.Column` object,
- and "operator" is a string
- containing the operator to use. In order to specify a column name
- when a :class:`_schema.Column` object is not available,
- while ensuring
+ "column" is a SQL expression element or the name of a column as
+ string, most typically a :class:`_schema.Column` object,
+ and "operator" is a string containing the operator to use.
+ In order to specify a column name when a :class:`_schema.Column`
+ object is not available, while ensuring
that any necessary quoting rules take effect, an ad-hoc
:class:`_schema.Column` or :func:`_expression.column`
- object should be
- used.
+ object should be used. ``column`` may also be a string SQL
+ expression when passed as :func:`_expression.literal_column`
:param name:
Optional, the in-database name of this constraint.