From f503b6ad7f94eaff277ad15d18ccd6e5a15c3306 Mon Sep 17 00:00:00 2001 From: ber Date: Fri, 1 Jul 2011 15:17:32 +0000 Subject: [PATCH] The PostgreSQL backend quotes database names now for CREATE and DROP, enabling more exotic tracker names. Closes issue2550497. Thanks to Sebastian Harl for providing the patch. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4627 57a73879-2fb5-44c3-a270-3262357dd7e2 --- CHANGES.txt | 3 +++ roundup/backends/back_postgresql.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 5968793..e8309dd 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -15,6 +15,9 @@ Features: Fixed: +- The PostgreSQL backend quotes database names now for CREATE and DROP, + enabling more exotic tracker names. Closes issue2550497. + Thanks to Sebastian Harl for providing the patch. (Bernhard Reiter) - Updated the url to point to www.roundup-tracker.org in two places in the docs. (Bernhard Reiter) - Do not depend on a CPython implementation detail anymore to make Roundup diff --git a/roundup/backends/back_postgresql.py b/roundup/backends/back_postgresql.py index defa905..9a6d034 100644 --- a/roundup/backends/back_postgresql.py +++ b/roundup/backends/back_postgresql.py @@ -35,7 +35,7 @@ def connection_dict(config, dbnamestr=None): def db_create(config): """Clear all database contents and drop database itself""" - command = "CREATE DATABASE %s WITH ENCODING='UNICODE'"%config.RDBMS_NAME + command = "CREATE DATABASE \"%s\" WITH ENCODING='UNICODE'"%config.RDBMS_NAME if config.RDBMS_TEMPLATE : command = command + " TEMPLATE=%s" % config.RDBMS_TEMPLATE logging.getLogger('roundup.hyperdb').info(command) @@ -43,7 +43,7 @@ def db_create(config): def db_nuke(config, fail_ok=0): """Clear all database contents and drop database itself""" - command = 'DROP DATABASE %s'% config.RDBMS_NAME + command = 'DROP DATABASE "%s"'% config.RDBMS_NAME logging.getLogger('roundup.hyperdb').info(command) db_command(config, command) -- 2.30.2