diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Truncate.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Truncate.php
index e2fa83d..ad31a6b 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Truncate.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Truncate.php
@@ -9,4 +9,20 @@
 
 use Drupal\Core\Database\Query\Truncate as QueryTruncate;
 
-class Truncate extends QueryTruncate { }
+class Truncate extends QueryTruncate {
+  public function __toString() {
+    // TRUNCATE is actually a DDL statement on PostgreSQL, and DDL statements
+    // are not transactional, and result in an implicit COMMIT. When we are in a
+    // transaction, fallback to the slower, but transactional, DELETE.
+    if ($this->connection->inTransaction()) {
+      // Create a comment string to prepend to the query.
+      $comments = $this->connection->makeComment($this->comments);
+      return $comments . 'DELETE FROM {' . $this->connection->escapeTable($this->table) . '}';
+    }
+    else {
+      return parent::__toString();
+    }
+  }
+}
