diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ffdf9c4..83cf4869 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Allow specifying operator in search anywhere - MySQL 5.0-: Do not load partitioning info in alter table (bug #1099) - PostgreSQL: Show structure of inherited tables +- PostgreSQL: Hide only partitions, not all inherited tables from menu - PostgreSQL 11-: Avoid duplicate oid in table status (bug #1089) - Plugins: Methods processList() and killProcess() diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 9d4e7223..65f29a7f 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -340,7 +340,7 @@ if (isset($_GET["pgsql"])) { } function partitionsInfo(string $table): array { - $row = connection()->query("SELECT * FROM pg_partitioned_table WHERE partrelid = " . driver()->tableOid($table))->fetch_assoc(); + $row = connection()->query("SELECT * FROM pg_partitioned_table WHERE partrelid = " . $this->tableOid($table))->fetch_assoc(); if ($row) { $attrs = get_vals("SELECT attname FROM pg_attribute WHERE attrelid = $row[partrelid] AND attnum IN (" . str_replace(" ", ", ", $row["partattrs"]) . ")"); //! ordering $by = array('h' => 'HASH', 'l' => 'LIST', 'r' => 'RANGE'); @@ -453,7 +453,7 @@ ORDER BY 1"; obj_description(oid, 'pg_class') AS \"Comment\", " . (min_version(12) ? "''" : "CASE WHEN relhasoids THEN 'oid' ELSE '' END") . " AS \"Oid\", reltuples AS \"Rows\", - (SELECT inhparent FROM pg_inherits WHERE inhrelid = oid) AS inherited, + " . (min_version(10) ? "relispartition::int AS partition," : "") . " current_schema() AS nspname FROM pg_class WHERE relkind IN ('r', 'm', 'v', 'f', 'p') diff --git a/adminer/include/adminer.inc.php b/adminer/include/adminer.inc.php index f68c15e0..69fd67f2 100644 --- a/adminer/include/adminer.inc.php +++ b/adminer/include/adminer.inc.php @@ -1100,7 +1100,7 @@ class Adminer { foreach ($tables as $table => $status) { $table = "$table"; // do not highlight "0" as active everywhere $name = adminer()->tableName($status); - if ($name != "" && !$status["inherited"]) { + if ($name != "" && !$status["partition"]) { echo '