]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL: Include inherited tables in table_status (bug #1031)
authorJakub Vrana <jakub@vrana.cz>
Mon, 14 Apr 2025 11:13:08 +0000 (13:13 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 14 Apr 2025 11:13:08 +0000 (13:13 +0200)
adminer/drivers/pgsql.inc.php
adminer/include/adminer.inc.php
phpstan.neon
plugins/menu-links.php

index 49850650f64865ba5d59dbae79878f52d55f4e39..26855a76a00e0568b6c483af09a743bac4783ee7 100644 (file)
@@ -427,12 +427,13 @@ 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\",
+       inhparent AS inherited,
        current_schema() AS nspname
 FROM pg_class
 LEFT JOIN pg_inherits ON inhrelid = oid
 WHERE relkind IN ('r', 'm', 'v', 'f', 'p')
 AND relnamespace = " . driver()->nsOid . "
-AND " . ($name != "" ? "relname = " . q($name) : "inhparent IS NULL ORDER BY relname")) as $row //! Auto_increment
+" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")) as $row //! Auto_increment
                ) {
                        $return[$row["Name"]] = $row;
                }
index 463c4ff8de064cd61f2993168288d64789b100dc..dd3af767147ccf01baf04e7d7b2353cd12356c6e 100644 (file)
@@ -1083,7 +1083,7 @@ class Adminer {
                foreach ($tables as $table => $status) {
                        $table = "$table"; // do not highlight "0" as active everywhere
                        $name = adminer()->tableName($status);
-                       if ($name != "") {
+                       if ($name != "" && !$status["inherited"]) {
                                echo '<li><a href="' . h(ME) . 'select=' . urlencode($table) . '"'
                                        . bold($_GET["select"] == $table || $_GET["edit"] == $table, "select")
                                        . " title='" . lang('Select data') . "'>" . lang('select') . "</a> "
index f07f05367040706631785ddc68d6b6d4f6d07524..05b6004e75433ab15053509be57f06a8d31d260c 100644 (file)
@@ -61,7 +61,7 @@ parameters:
                max: 80499
 
        typeAliases:
-               TableStatus: "array{Name:string, Engine?:?string, Comment?:string, Oid?:numeric-string, Rows?:?numeric-string, Collation?:string, Auto_increment?:?numeric-string, Data_length?:numeric-string, Index_length?:numeric-string, Data_free?:numeric-string, Create_options?:string, nspname?:string}"
+               TableStatus: "array{Name:string, Engine?:?string, Comment?:string, Oid?:numeric-string, Rows?:?numeric-string, Collation?:string, Auto_increment?:?numeric-string, Data_length?:numeric-string, Index_length?:numeric-string, Data_free?:numeric-string, Create_options?:string, inherited?:numeric-string, nspname?:string}"
                Field: "array{field?:string, full_type:string, type:string, length:numeric-string, unsigned:string, default?:string, null:bool, auto_increment:bool, collation:string, privileges:int[], comment:string, primary:bool, generated:string, orig?:string, on_update?:string, on_delete?:string, default_constraint?: string}"
                FieldType: "array{type:string, length:numeric-string, unsigned:string, collation:string}" # subset of RoutineField and Field
                RoutineField: "array{field:string, type:string, length:numeric-string, unsigned:string, null:bool, full_type:string, collation:string, inout?:string}"
index 83e4a483fb74c4ce29107a4eb81ca4b8681643fd..544f2cfed1f166a88baeb54c35c5057be3e409a8 100644 (file)
@@ -36,7 +36,7 @@ class AdminerMenuLinks extends Adminer\Plugin {
                foreach ($tables as $table => $status) {
                        $table = "$table"; // do not highlight "0" as active everywhere
                        $name = Adminer\adminer()->tableName($status);
-                       if ($name != "") {
+                       if ($name != "" && !$status["inherited"]) {
                                echo '<li>';
                                if (!$menu) {
                                        echo '<a href="' . Adminer\h(Adminer\ME) . 'select=' . urlencode($table) . '"'