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

PostgreSQL: Export ENUM types (bug #587)

This commit is contained in:
Jakub Vrana
2025-02-26 23:55:17 +01:00
parent 5eac6a44bd
commit d23a0eb77e
6 changed files with 29 additions and 6 deletions

View File

@@ -909,11 +909,11 @@ function input($field, $value, $function) {
$functions = (isset($_GET["select"]) || $reset ? array("orig" => lang('original')) : array()) + $adminer->editFunctions($field);
$disabled = stripos($field["default"], "GENERATED ALWAYS AS ") === 0 ? " disabled=''" : "";
$attrs = " name='fields[$name]'$disabled";
if ($jush == "pgsql" && in_array($field["type"], (array) $structured_types[lang('User types')])) {
$enums = get_vals("SELECT enumlabel FROM pg_enum WHERE enumtypid = " . $types[$field["type"]] . " ORDER BY enumsortorder");
if (in_array($field["type"], (array) $structured_types[lang('User types')])) {
$enums = type_values($types[$field["type"]]);
if ($enums) {
$field["type"] = "enum";
$field["length"] = "'" . implode("','", array_map('addslashes', $enums)) . "'";
$field["length"] = $enums;
}
}
if ($field["type"] == "enum") {