[CalendarServer-changes] [14510] CalendarServer/trunk/txdav/base/datastore/subpostgres.py

source_changes at macosforge.org source_changes at macosforge.org
Thu Mar 5 11:40:45 PST 2015


Revision: 14510
          http://trac.calendarserver.org//changeset/14510
Author:   wsanchez at apple.com
Date:     2015-03-05 11:40:45 -0800 (Thu, 05 Mar 2015)
Log Message:
-----------
Break schema SQL into statements.

Modified Paths:
--------------
    CalendarServer/trunk/txdav/base/datastore/subpostgres.py

Modified: CalendarServer/trunk/txdav/base/datastore/subpostgres.py
===================================================================
--- CalendarServer/trunk/txdav/base/datastore/subpostgres.py	2015-03-05 18:51:40 UTC (rev 14509)
+++ CalendarServer/trunk/txdav/base/datastore/subpostgres.py	2015-03-05 19:40:45 UTC (rev 14510)
@@ -38,6 +38,7 @@
 from twisted.internet.defer import Deferred
 from txdav.base.datastore.dbapiclient import DBAPIConnector
 from txdav.base.datastore.dbapiclient import postgresPreflight
+from txdav.common.datastore.sql_tables import splitSQLString
 from txdav.common.icommondatastore import InternalDataStoreError
 
 from twisted.application.service import MultiService
@@ -423,7 +424,8 @@
         if sqlToExecute is not None:
             connection = self.produceConnection()
             cursor = connection.cursor()
-            cursor.execute(sqlToExecute)
+            for statement in splitSQLString(sqlToExecute):
+                cursor.execute(statement)
             connection.commit()
             connection.close()
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/calendarserver-changes/attachments/20150305/4e1af426/attachment.html>


More information about the calendarserver-changes mailing list