Roundup Tracker - Issues

Issue 1374235

classification
enforce correct encoding of Pg backend
Type: Severity: normal
Components: Database Versions:
process
Status: closed fixed
:
: richard : richard
Priority: normal :

Created on 2005-12-06 10:53 by anonymous, last changed 2006-01-20 02:24 by richard.

Messages
msg2067 Author: [hidden] (anonymous) Date: 2005-12-06 10:53
Hello,
when you (I - blush) don't have a good encoding in
PostgreSQL's template1 database, the roundup database
gets created with the wrong encoding, and bad problems
might ensue (eg. not being able to use accented
characters). In this case, roundup throws very ugly
unicode decoding errors.

I suggest the following fix:

In roundup/backends/back_postgresql.py, there is:

def db_create(config):
    """Clear all database contents and drop database
itself"""
    command = 'CREATE DATABASE %s'%config.RDBMS_NAME
    logging.getLogger('hyperdb').info(command)
    db_command(config, command)

This should be changed to read

def db_create(config):
    """Clear all database contents and drop database
itself"""
    command = "CREATE DATABASE %s WITH ENCODING =
'UNICODE'"%config.RDBMS_NAME
    logging.getLogger('hyperdb').info(command)
    db_command(config, command)

to enforce UNICODE for the roundup database. This might
break with older PostgreSQL installations (I didn't
check), but should hopefully solve the problem for
anyone using 7.3 and up.
msg2068 Author: [hidden] (richard) Date: 2006-01-20 02:24
Logged In: YES 
user_id=6405

the "with ENCODING=UNICODE" syntax breaks under psql 7.4 
msg2069 Author: [hidden] (richard) Date: 2006-01-20 02:26
Logged In: YES 
user_id=6405

whoops, sorry, my bad. missed the quoting. 
History
Date User Action Args
2005-12-06 10:53:29anonymouscreate