diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
index 4a5f404..1a11a34 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
@@ -466,9 +466,14 @@ protected function createPrimaryKeySql($fields) {
    * {@inheritdoc}
    */
   public function tableExists($table) {
-    $prefixInfo = $this->getPrefixInfo($table, TRUE);
+    try {
+      $prefixInfo = $this->getPrefixInfo($table, TRUE);

-    return (bool) $this->connection->query("SELECT 1 FROM pg_tables WHERE schemaname = :schema AND tablename = :table", array(':schema' => $prefixInfo['schema'], ':table' => $prefixInfo['table']))->fetchField();
+      return (bool) $this->connection->query("SELECT 1 FROM pg_tables WHERE schemaname = :schema AND tablename = :table", array(':schema' => $prefixInfo['schema'], ':table' => $prefixInfo['table']))->fetchField();
+    }
+    catch (\Exception $e) {
+      return FALSE;
+    }
   }

   function renameTable($table, $new_name) {
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
index 4b954ed..022a5c8 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
@@ -23,10 +23,15 @@ class Schema extends DatabaseSchema {
   protected $defaultSchema = 'main';

   public function tableExists($table) {
-    $info = $this->getPrefixInfo($table);
+    try {
+      $info = $this->getPrefixInfo($table);

-    // Don't use {} around sqlite_master table.
-    return (bool) $this->connection->query('SELECT 1 FROM ' . $info['schema'] . '.sqlite_master WHERE type = :type AND name = :name', array(':type' => 'table', ':name' => $info['table']))->fetchField();
+      // Don't use {} around sqlite_master table.
+      return (bool) $this->connection->query('SELECT 1 FROM ' . $info['schema'] . '.sqlite_master WHERE type = :type AND name = :name', array(':type' => 'table', ':name' => $info['table']))->fetchField();
+    }
+    catch (\Exception $e) {
+      return FALSE;
+    }
   }

   public function fieldExists($table, $column) {
diff --git a/core/lib/Drupal/Core/Database/Schema.php b/core/lib/Drupal/Core/Database/Schema.php
index 8b9eb7e..766a660 100644
--- a/core/lib/Drupal/Core/Database/Schema.php
+++ b/core/lib/Drupal/Core/Database/Schema.php
@@ -161,14 +161,19 @@ protected function buildTableNameCondition($table_name, $operator = '=', $add_pr
    *   TRUE if the given table exists, otherwise FALSE.
    */
   public function tableExists($table) {
-    $condition = $this->buildTableNameCondition($table);
-    $condition->compile($this->connection, $this);
-    // Normally, we would heartily discourage the use of string
-    // concatenation for conditionals like this however, we
-    // couldn't use db_select() here because it would prefix
-    // information_schema.tables and the query would fail.
-    // Don't use {} around information_schema.tables table.
-    return (bool) $this->connection->query("SELECT 1 FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
+    try {
+      $condition = $this->buildTableNameCondition($table);
+      $condition->compile($this->connection, $this);
+      // Normally, we would heartily discourage the use of string
+      // concatenation for conditionals like this however, we
+      // couldn't use db_select() here because it would prefix
+      // information_schema.tables and the query would fail.
+      // Don't use {} around information_schema.tables table.
+      return (bool) $this->connection->query("SELECT 1 FROM information_schema.tables WHERE " . (string) $condition, $condition->arguments())->fetchField();
+    }
+    catch (\Exception $e) {
+      return FALSE;
+    }
   }

   /**
