From 2d58fc61e28d07f9b63df5a2ba9e2c88e1e20425 Mon Sep 17 00:00:00 2001 From: Stephane Wirtel Date: Fri, 30 Jan 2009 13:52:39 +0100 Subject: [PATCH] [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 --- bin/service/web_services.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/service/web_services.py b/bin/service/web_services.py index 44c853a6d4b..53936d202f5 100644 --- a/bin/service/web_services.py +++ b/bin/service/web_services.py @@ -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')