summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/postgresql/base.py
diff options
context:
space:
mode:
authorMalik Diarra <malik.diarra@gmail.com>2014-08-17 01:39:14 +0200
committerMalik Diarra <malik.diarra@gmail.com>2014-08-17 01:56:02 +0200
commit8e03430acdb98d7e5fef4a48a3120b928ed3266d (patch)
treef40d1552cb8d72f7bf858937b4d3e1450a762e6c /lib/sqlalchemy/dialects/postgresql/base.py
parentd6873904c40134df787ffe5459d61d3663bf5d5f (diff)
downloadsqlalchemy-8e03430acdb98d7e5fef4a48a3120b928ed3266d.tar.gz
quoting tablespace name in create table command in postgresql dialect
Diffstat (limited to 'lib/sqlalchemy/dialects/postgresql/base.py')
-rw-r--r--lib/sqlalchemy/dialects/postgresql/base.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/sqlalchemy/dialects/postgresql/base.py b/lib/sqlalchemy/dialects/postgresql/base.py
index 9b30bf894..b09eaba72 100644
--- a/lib/sqlalchemy/dialects/postgresql/base.py
+++ b/lib/sqlalchemy/dialects/postgresql/base.py
@@ -1459,7 +1459,8 @@ class PGDDLCompiler(compiler.DDLCompiler):
on_commit_options = table.dialect_options['postgresql']['on_commit'].replace("_", " ").upper()
table_opts.append('ON COMMIT %s' % on_commit_options)
if table.dialect_options['postgresql']['tablespace']:
- table_opts.append('TABLESPACE %s' % table.dialect_options['postgresql']['tablespace'])
+ tablespace_name = table.dialect_options['postgresql']['tablespace']
+ table_opts.append('TABLESPACE %s' % self.preparer.quote(tablespace_name))
return ' '.join(table_opts)