comparison roundup/backends/back_postgresql.py @ 4471:4f353d71d716

Configuration issue: On some postgresql 8.4 installations (notably on debian squeeze) the default template database used for database creation doesn't match the needed character encoding UTF8 -- a new config option 'template' in the rdbms section now allows specification of the template. You know you need this option if you get the error message: psycopg2.DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII) HINT: Use the same encoding as in the template database, or use template0 as template.
author Ralf Schlatterbeck <schlatterbeck@users.sourceforge.net>
date Wed, 16 Mar 2011 11:26:50 +0000
parents 67bef70ab9b9
children f6c49df25048
comparison
equal deleted inserted replaced
4470:21a95ba01a42 4471:4f353d71d716
34 return d 34 return d
35 35
36 def db_create(config): 36 def db_create(config):
37 """Clear all database contents and drop database itself""" 37 """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
39 if config.RDBMS_TEMPLATE :
40 command = command + " TEMPLATE=%s" % config.RDBMS_TEMPLATE
39 logging.getLogger('roundup.hyperdb').info(command) 41 logging.getLogger('roundup.hyperdb').info(command)
40 db_command(config, command) 42 db_command(config, command)
41 43
42 def db_nuke(config, fail_ok=0): 44 def db_nuke(config, fail_ok=0):
43 """Clear all database contents and drop database itself""" 45 """Clear all database contents and drop database itself"""

Roundup Issue Tracker: http://roundup-tracker.org/