diff --git a/core/lib/Drupal/Core/Cache/DatabaseBackend.php b/core/lib/Drupal/Core/Cache/DatabaseBackend.php index 48018b1..81e83bb 100644 --- a/core/lib/Drupal/Core/Cache/DatabaseBackend.php +++ b/core/lib/Drupal/Core/Cache/DatabaseBackend.php @@ -235,7 +235,9 @@ public function setMultiple(array $items) { } // Use a transaction so that the database can write the changes in a single - // commit. + // commit. The transaction is started after calculating the tag checksums + // since that can create a table and this causes an exception when using + // PostgreSQL. $transaction = $this->connection->startTransaction(); try { @@ -247,8 +249,9 @@ public function setMultiple(array $items) { ->insert($this->bin) ->fields(array('cid', 'expire', 'created', 'tags', 'checksum', 'data', 'serialized')); foreach ($values as $fields) { - // Only pass the values to values since the order of $fields matches the - // order of the insert fields. + // Only pass the values since the order of $fields matches the order of + // the insert fields. This is a performance optimization to avoid + // unnecessary loops within the method. $query->values(array_values($fields)); }