1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-13 18:14:07 +02:00

PostgreSQL: Constraint enum values in editing (bug #270)

This commit is contained in:
Jakub Vrana
2025-02-22 13:39:44 +01:00
parent 20d722b882
commit e282ced59e
3 changed files with 14 additions and 6 deletions

View File

@@ -729,7 +729,7 @@ ORDER BY SPECIFIC_NAME');
}
function types() {
return get_vals("SELECT typname
return get_key_vals("SELECT oid, typname
FROM pg_type
WHERE typnamespace = (SELECT oid FROM pg_namespace WHERE nspname = current_schema())
AND typtype IN ('b','d','e')
@@ -752,9 +752,9 @@ AND typelem = 0"
$connection2 = $connection;
}
$return = $connection2->query("SET search_path TO " . idf_escape($schema));
foreach (types() as $type) { //! get types from current_schemas('t')
foreach (types() as $key => $type) { //! get types from current_schemas('t')
if (!isset($types[$type])) {
$types[$type] = 0;
$types[$type] = $key;
$structured_types[lang('User types')][] = $type;
}
}