[FIX] Set the template0 as default template when you create a new database
http://www.postgresql.org/docs/8.2/static/manage-ag-templatedbs.html http://www.postgresql.org/docs/8.2/static/app-pgrestore.html Thank you to Christophe Chauvet (SYLEAM) for this fix. bzr revid: stephane@tinyerp.com-20090130125239-4h8agooloymfjy0m
This commit is contained in:
@@ -204,7 +204,7 @@ class db(netsvc.Service):
|
||||
cr = db.cursor()
|
||||
cr.autocommit(True)
|
||||
try:
|
||||
cr.execute('CREATE DATABASE "%s" ENCODING \'unicode\'' % db_name)
|
||||
cr.execute("""CREATE DATABASE "%s" ENCODING 'unicode' TEMPLATE 'template0'""" % db_name)
|
||||
finally:
|
||||
cr.close()
|
||||
sql_db.close_db('template1')
|
||||
|
||||
Reference in New Issue
Block a user