From 8e03430acdb98d7e5fef4a48a3120b928ed3266d Mon Sep 17 00:00:00 2001 From: Malik Diarra Date: Sun, 17 Aug 2014 01:39:14 +0200 Subject: quoting tablespace name in create table command in postgresql dialect --- lib/sqlalchemy/dialects/postgresql/base.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/sqlalchemy/dialects/postgresql/base.py') 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) -- cgit v1.2.1