## Adminer dev
-- PostgreSQL: Show partitioned tables as tables, not views
+- PostgreSQL: Move partitioned tables from table list to parent table
- Designs: adminer.css with 'prefers-color-scheme: dark' don't disable dark mode
- Plugins: Method bodyClass() to add <body class>
}
}
+ function inheritedTables(string $table): array {
+ return get_vals("SELECT c.relname
+FROM pg_class p
+JOIN pg_namespace n ON n.nspname = current_schema() AND n.oid = p.relnamespace
+JOIN pg_inherits ON inhparent = p.oid
+JOIN pg_class c ON inhrelid = c.oid
+WHERE p.relname = " . q($table) . " AND p.relkind = 'p'
+ORDER BY 1");
+ }
+
function supportsIndex(array $table_status): bool {
// returns true for "materialized view"
return $table_status["Engine"] != "view";
c.reltuples as \"Rows\",
n.nspname
FROM pg_class c
-JOIN pg_namespace n ON(n.nspname = current_schema() AND n.oid = c.relnamespace)
+JOIN pg_namespace n ON n.nspname = current_schema() AND n.oid = c.relnamespace
+LEFT JOIN pg_inherits ON inhrelid = c.oid
WHERE relkind IN ('r', 'm', 'v', 'f', 'p')
-" . ($name != "" ? "AND relname = " . q($name) : "ORDER BY relname")) as $row //! Index_length, Auto_increment
+" . ($name != "" ? "AND relname = " . q($name) : "AND inhparent IS NULL ORDER BY relname")) as $row //! Auto_increment
) {
$return[$row["Name"]] = $row;
}
function tableHelp(string $name, bool $is_view = false) {
}
+ /** Get inherited tables
+ * @return list<string>
+ */
+ function inheritedTables(string $table): array {
+ return array();
+ }
+
/** Check if C-style escapes are supported */
function hasCStyleEscapes(): bool {
return false;
'Partitions' => 'Oddíly',
'Partition name' => 'Název oddílu',
'Values' => 'Hodnoty',
+ 'Inherited tables' => 'Zděděné tabulky',
'View' => 'Pohled',
'Materialized view' => 'Materializovaný pohled',
'Partitions' => 'Xx',
'Partition name' => 'Xx',
'Values' => 'Xx',
+ 'Inherited tables' => 'Xx',
'View' => 'Xx',
'Materialized view' => 'Xx',
}
echo '<p class="links"><a href="' . h(ME) . 'trigger=' . urlencode($TABLE) . '">' . lang('Add trigger') . "</a>\n";
}
+
+$inherited = driver()->inheritedTables($TABLE);
+if ($inherited) {
+ echo "<h3 id='inherited'>" . lang('Inherited tables') . "</h3>\n";
+ echo "<ul>\n";
+ foreach ($inherited as $val) {
+ echo "<li><a href='" . h(ME . "table=" . urlencode($val)) . "'>" . h($val) . "</a>\n";
+ }
+ echo "</ul>\n";
+}