mirror of
https://github.com/vrana/adminer.git
synced 2026-02-24 23:51:25 +01:00
PostgreSQL: Mark unique partial indexes as unique (fix #1172)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
## Adminer dev
|
||||
- PostgreSQL: Mark unique partial indexes as unique (bug #1172)
|
||||
- Plugins: Methods showVariables() and showStatus() (bug #1157)
|
||||
|
||||
## Adminer 5.4.1 (released 2025-09-26)
|
||||
|
||||
@@ -539,7 +539,7 @@ WHERE indrelid = $table_oid
|
||||
ORDER BY indisprimary DESC, indisunique DESC", $connection2) as $row
|
||||
) {
|
||||
$relname = $row["relname"];
|
||||
$return[$relname]["type"] = ($row["partial"] ? "INDEX" : ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX")));
|
||||
$return[$relname]["type"] = ($row["indisprimary"] ? "PRIMARY" : ($row["indisunique"] ? "UNIQUE" : "INDEX"));
|
||||
$return[$relname]["columns"] = array();
|
||||
$return[$relname]["descs"] = array();
|
||||
$return[$relname]["algorithm"] = $row["amname"];
|
||||
|
||||
@@ -244,7 +244,7 @@ function get_rows(string $query, ?Db $connection2 = null, string $error = "<p cl
|
||||
*/
|
||||
function unique_array(?array $row, array $indexes) {
|
||||
foreach ($indexes as $index) {
|
||||
if (preg_match("~PRIMARY|UNIQUE~", $index["type"])) {
|
||||
if (preg_match("~PRIMARY|UNIQUE~", $index["type"]) && !$index["partial"]) {
|
||||
$return = array();
|
||||
foreach ($index["columns"] as $key) {
|
||||
if (!isset($row[$key])) { // NULL is ambiguous
|
||||
|
||||
Reference in New Issue
Block a user