Skip to content

Commit 6c773df

Browse files
Bernhard ReiterBernhard Reiter
authored andcommitted
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.
1 parent 53c2173 commit 6c773df

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ Features:
1515

1616
Fixed:
1717

18+
- The PostgreSQL backend quotes database names now for CREATE and DROP,
19+
enabling more exotic tracker names. Closes issue2550497.
20+
Thanks to Sebastian Harl for providing the patch. (Bernhard Reiter)
1821
- Updated the url to point to www.roundup-tracker.org in two places in the
1922
docs. (Bernhard Reiter)
2023
- Do not depend on a CPython implementation detail anymore to make Roundup

roundup/backends/back_postgresql.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,15 @@ def connection_dict(config, dbnamestr=None):
3535

3636
def db_create(config):
3737
"""Clear all database contents and drop database itself"""
38-
command = "CREATE DATABASE %s WITH ENCODING='UNICODE'"%config.RDBMS_NAME
38+
command = "CREATE DATABASE \"%s\" WITH ENCODING='UNICODE'"%config.RDBMS_NAME
3939
if config.RDBMS_TEMPLATE :
4040
command = command + " TEMPLATE=%s" % config.RDBMS_TEMPLATE
4141
logging.getLogger('roundup.hyperdb').info(command)
4242
db_command(config, command)
4343

4444
def db_nuke(config, fail_ok=0):
4545
"""Clear all database contents and drop database itself"""
46-
command = 'DROP DATABASE %s'% config.RDBMS_NAME
46+
command = 'DROP DATABASE "%s"'% config.RDBMS_NAME
4747
logging.getLogger('roundup.hyperdb').info(command)
4848
db_command(config, command)
4949

0 commit comments

Comments
 (0)