[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:
Stephane Wirtel
2009-01-30 13:52:39 +01:00
parent b9ae9fd0e8
commit 2d58fc61e2
+1 -1
View File
@@ -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')