Author: reinhard
Date: 2008-11-13 14:03:00 -0600 (Thu, 13 Nov 2008)
New Revision: 9898

Modified:
   trunk/gnue-common/src/datasources/drivers/sql/postgresql/Behavior.py
Log:
CREATE DATABASE may not be in a block with other statements.


Modified: trunk/gnue-common/src/datasources/drivers/sql/postgresql/Behavior.py
===================================================================
--- trunk/gnue-common/src/datasources/drivers/sql/postgresql/Behavior.py        
2008-10-26 18:05:00 UTC (rev 9897)
+++ trunk/gnue-common/src/datasources/drivers/sql/postgresql/Behavior.py        
2008-11-13 20:03:00 UTC (rev 9898)
@@ -118,10 +118,12 @@
       self.__connection.sql0 (cmd)
       self.__connection.commit ()
 
+    # Cancel transaction, create database must be outside transaction
+    self.__connection.sql0 ("ABORT")
+
     # Now go and create that new database
-    cmd = "ABORT; CREATE DATABASE %s WITH OWNER %s ENCODING = 'UNICODE'; 
BEGIN" 
+    cmd = "CREATE DATABASE %s WITH OWNER %s ENCODING = 'UNICODE'" 
     self.__connection.sql0 (cmd % (dbname, owner))
-    self.__connection.commit ()
 
     self.__connection.close ()
 



_______________________________________________
commit-gnue mailing list
commit-gnue@gnu.org
http://lists.gnu.org/mailman/listinfo/commit-gnue

Reply via email to