diff --git a/engines/mysql.inc b/engines/mysql.inc
index 545423c..f1beaaf 100644
--- a/engines/mysql.inc
+++ b/engines/mysql.inc
@@ -38,6 +38,15 @@ class SchemaDatabaseSchema_mysql extends DatabaseSchema_mysql {
     $info = $this->connection->getConnectionOptions();
     $database = $info['database'];
 
+    // Apply table prefixes.
+    if (isset($table_name)) {
+      $table_info = $this->connection->schema()->getPrefixInfo($table_name);
+      if (!empty($table_info['database'])) {
+        $database = $table_info['database'];
+      }
+      $table_name = $table_info['table'];
+    }
+
     $tables = array();
     $args = array(':database' => $database);
     $sql = 'SELECT table_name, table_comment
diff --git a/engines/pgsql.inc b/engines/pgsql.inc
index 4b702b5..06eb374 100644
--- a/engines/pgsql.inc
+++ b/engines/pgsql.inc
@@ -40,6 +40,13 @@ class SchemaDatabaseSchema_pgsql extends DatabaseSchema_pgsql {
     $info = $this->connection->getConnectionOptions();
     $database = $info['database'];
 
+    // Apply table prefixes.
+    if (isset($table_name)) {
+      $table_info = $this->connection->schema()->getPrefixInfo($table_name);
+      // @todo What do we do with $table_info['schema']?
+      $table_name = $table_info['table'];
+    }
+
     //
     // Retrieve information about all columns in the database from the
     // 'columns' table of 'information_schema'.  In pgsql, TABLE_CATALOG
