[gnue] r9898 - trunk/gnue-common/src/datasources/drivers/sql/postgresql

[email protected]
Newsgroups gmane.comp.cms.gnue.cvs
Message-ID <[email protected]>
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 ()
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.