diff --git a/webform.install b/webform.install
index adae53f..dcfa395 100644
--- a/webform.install
+++ b/webform.install
@@ -1777,13 +1777,13 @@ function webform_update_7415() {
  * Add columns for serial numbered submissions. Add serial numbers to existing submissions.
  */
 function webform_update_7416() {
+  // Postgres has a transactional DDL.
+  $txn1 = db_transaction();
+
   // Delete stray entries from the Webform tables before adding serial numbers.
   db_query("DELETE FROM {webform_submissions} WHERE nid NOT IN (SELECT nid FROM {webform})");
   db_query("DELETE FROM {webform_submitted_data} WHERE nid NOT IN (SELECT nid FROM {webform})");
 
-  // Postgres has a transactional DDL.
-  db_transaction();
-
   // Add next_serial column to webform.
   $spec = array(
     'description' => 'The serial number to give to the next submission to this webform.',
@@ -1809,7 +1809,7 @@ function webform_update_7416() {
   // Add serial numbers to all submissions.
   // MySQL COMMITs transactions when it encounters a DDL change, so start the
   // transaction. In Postgres transactions will nest, which is fine.
-  db_transaction();
+  $txn2 = db_transaction();
 
   // Repeat for every Webform.
   $nids = db_select('webform', 'w')
diff --git a/webform.module b/webform.module
index 6027bbf..8b62195 100644
--- a/webform.module
+++ b/webform.module
@@ -4663,7 +4663,7 @@ function _webform_submission_serial_next_value($nid, $do_increment = TRUE) {
   // at the same time do not have duplicate numbers.
   // Do not lock unless incrementing.
   if ($do_increment) {
-    db_transaction();
+    $txn = db_transaction();
   }
 
   // Get the next_serial value.
