diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-12 20:21:18 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2013-10-12 20:21:18 -0400 |
commit | a2cce1bf43552e699f2babe7e4750354f2d580fe (patch) | |
tree | 6a51ca1dba5b26cd69770f777ba89c429cafb177 /lib/sqlalchemy | |
parent | 9bc9d5c1068be878118202259add3c2e1bcec0cb (diff) | |
download | sqlalchemy-a2cce1bf43552e699f2babe7e4750354f2d580fe.tar.gz |
Parenthesis will be applied to a compound SQL expression as
rendered in the column list of a CREATE INDEX statement.
[ticket:2742]
Diffstat (limited to 'lib/sqlalchemy')
-rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index 83ad1d46f..06ee8c3a2 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -1101,7 +1101,10 @@ class PGDDLCompiler(compiler.DDLCompiler): % ( ', '.join([ self.sql_compiler.process( - expr, include_table=False, literal_binds=True) + + expr.self_group() + if not isinstance(expr, expression.ColumnClause) + else expr, + include_table=False, literal_binds=True) + (c.key in ops and (' ' + ops[c.key]) or '') for expr, c in zip(index.expressions, index.columns)]) ) |