diff options
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
| -rw-r--r-- | lib/sqlalchemy/dialects/postgresql/base.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py index bf257ab3f..5292b3901 100644 --- a/lib/sqlalchemy/dialects/postgresql/base.py +++ b/lib/sqlalchemy/dialects/postgresql/base.py @@ -2322,6 +2322,9 @@ class PGDDLCompiler(compiler.DDLCompiler): if concurrently: text += "CONCURRENTLY " + if create.if_not_exists: + text += "IF NOT EXISTS " + text += "%s ON %s " % ( self._prepared_index_name(index, include_schema=False), preparer.format_table(index.table), @@ -2405,6 +2408,9 @@ class PGDDLCompiler(compiler.DDLCompiler): if concurrently: text += "CONCURRENTLY " + if drop.if_exists: + text += "IF EXISTS " + text += self._prepared_index_name(index, include_schema=True) return text |
