1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 09:34:10 +02:00

PostgreSQL: Support indexes on materialized views (PR #467)

This commit is contained in:
Jakub Vrana
2025-03-07 13:13:53 +01:00
parent 22a544f71c
commit 28c171f681
4 changed files with 21 additions and 8 deletions

View File

@@ -293,6 +293,10 @@ if (isset($_GET["pgsql"])) {
}
}
function supportsIndex($table_status) {
return $table_status["Engine"] != "view";
}
function hasCStyleEscapes() {
static $c_style;
if ($c_style === null) {

View File

@@ -230,6 +230,14 @@ abstract class SqlDriver {
return false;
}
/** Check whether table supports indexes
* @param array result of table_status()
* @return bool
*/
function supportsIndex($table_status) {
return !is_view($table_status);
}
/** Get defined check constraints
* @param string
* @return array [$name => $clause]

View File

@@ -26,8 +26,7 @@ if ($fields) {
$adminer->tableStructurePrint($fields);
}
if (!is_view($table_status)) {
if (support("indexes")) {
if (support("indexes") && $driver->supportsIndex($table_status)) {
echo "<h3 id='indexes'>" . lang('Indexes') . "</h3>\n";
$indexes = indexes($TABLE);
if ($indexes) {
@@ -36,6 +35,7 @@ if (!is_view($table_status)) {
echo '<p class="links"><a href="' . h(ME) . 'indexes=' . urlencode($TABLE) . '">' . lang('Alter indexes') . "</a>\n";
}
if (!is_view($table_status)) {
if (fk_support($table_status)) {
echo "<h3 id='foreign-keys'>" . lang('Foreign keys') . "</h3>\n";
$foreign_keys = foreign_keys($TABLE);

View File

@@ -2,6 +2,7 @@ Adminer dev:
Fix bulk operations with tables
Remove duplicate columns from select (bug #670)
MariaDB: Fix link to status variable doc (bug #658)
PostgreSQL: Support indexes on materialized views (PR #467)
Adminer 5.0.0 (released 2025-03-07):
Speed up with disabled output buffering