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

PostgreSQL: Do not alter indexes with expressions

This commit is contained in:
Jakub Vrana
2025-02-26 21:24:47 +01:00
parent de7bb79132
commit 3dc87c1811
3 changed files with 23 additions and 20 deletions

View File

@@ -423,13 +423,15 @@ ORDER BY a.attnum"
$relname = $row["relname"];
$return[$relname]["type"] = ($row["indispartial"] ? "INDEX" : ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX")));
$return[$relname]["columns"] = array();
$return[$relname]["descs"] = array();
if ($row["indkey"]) {
foreach (explode(" ", $row["indkey"]) as $indkey) {
$return[$relname]["columns"][] = $columns[$indkey];
}
$return[$relname]["descs"] = array();
foreach (explode(" ", $row["indoption"]) as $indoption) {
$return[$relname]["descs"][] = ($indoption & 1 ? '1' : null); // 1 - INDOPTION_DESC
}
}
$return[$relname]["lengths"] = array();
}
return $return;

View File

@@ -40,7 +40,6 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
}
}
if ($columns) {
$existing = $indexes[$name];
if ($existing) {
ksort($existing["columns"]);
@@ -56,6 +55,7 @@ if ($_POST && !$error && !$_POST["add"] && !$_POST["drop_col"]) {
continue;
}
}
if ($columns) {
$alter[] = array($index["type"], $name, $set);
}
}

View File

@@ -1,4 +1,5 @@
Adminer dev:
PostgreSQL: Do not alter indexes with expressions
PostgreSQL: Fix export of indexes with expressions (bug #768)
SQLite: Support CHECK constraint
SQLite: Add command Check tables