From 63dd38c44d87e08bef4f06e7194257fe4543cce9 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Tue, 4 Mar 2025 19:40:30 +0100 Subject: [PATCH] PostgreSQL: Compute size of all databases (bug #881) --- adminer/drivers/pgsql.inc.php | 9 ++++++++- changes.txt | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 0d05854e..33be88ff 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -336,7 +336,14 @@ ORDER BY 1"; } function count_tables($databases) { - return array(); // would require reconnect + global $connection; + $return = array(); + foreach ($databases as $db) { + if ($connection->select_db($db)) { + $return[$db] = count(tables_list()); + } + } + return $return; } function table_status($name = "") { diff --git a/changes.txt b/changes.txt index 0f693f8d..103f917c 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,7 @@ Adminer dev: Speed up with disabled output buffering Don't autofocus computed fields in insert form +PostgreSQL: Compute size of all databases (bug #881) PostgreSQL: Do not alter indexes with expressions PostgreSQL: Fix export of indexes with expressions (bug #768) PostgreSQL: Display ENUM types