diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 65fbdbed..13b42d4b 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -205,7 +205,7 @@ if (isset($_GET["pgsql"])) { function table_status($name = "") { $return = array(); - foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN '' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids AS \"Oid\" + foreach (get_rows("SELECT relname AS \"Name\", CASE relkind WHEN 'r' THEN 'table' ELSE 'view' END AS \"Engine\", pg_relation_size(oid) AS \"Data_length\", pg_total_relation_size(oid) - pg_relation_size(oid) AS \"Index_length\", obj_description(oid, 'pg_class') AS \"Comment\", relhasoids AS \"Oid\", reltuples as \"Rows\" FROM pg_class WHERE relkind IN ('r','v') AND relnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())" diff --git a/adminer/script.inc.php b/adminer/script.inc.php index b75370af..d2ab833a 100644 --- a/adminer/script.inc.php +++ b/adminer/script.inc.php @@ -13,7 +13,10 @@ if ($_GET["script"] == "db") { foreach ($sums + array("Auto_increment" => 0, "Rows" => 0) as $key => $val) { if ($table_status[$key] != "") { $val = number_format($table_status[$key], 0, '.', lang(',')); - json_row("$key-$id", ($key == "Rows" && $table_status["Engine"] == "InnoDB" && $val ? "~ $val" : $val)); + json_row("$key-$id", ($key == "Rows" && $val && ( + $table_status["Engine"] == "InnoDB" || // MySQL InnoDB + $table_status["Engine"] == "table" // PostgreSQL table reltype + ) ? "~ $val" : $val)); if (isset($sums[$key])) { $sums[$key] += ($table_status["Engine"] != "InnoDB" || $key != "Data_free" ? $table_status[$key] : 0); } diff --git a/changes.txt b/changes.txt index 36e39a97..d7201026 100644 --- a/changes.txt +++ b/changes.txt @@ -3,6 +3,7 @@ Print current time next to executed SQL queries Highlight code in SQL command by CodeMirror Link to descending order Link to original table in EXPLAIN of SELECT * FROM table t +PostgreSQL: approximate row count in table overview Oracle: schema, processlist, table overview numbers Replace JSMin by better JavaScript minifier Don't use AJAX links and forms