1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 17:44:07 +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

@@ -1001,11 +1001,18 @@ if (!defined("DRIVER")) {
/* Not used is MySQL but checked in compile.php:
/** Get user defined types
* @return array
* @return array [$id => $name]
function types() {
return array();
}
/** Get values of user defined type
* @param int
* @return string
function type_values($id) {
return "";
}
/** Get existing schemas
* @return array
function schemas() {

View File

@@ -730,6 +730,11 @@ AND typelem = 0"
);
}
function type_values($id) {
$enums = get_vals("SELECT enumlabel FROM pg_enum WHERE enumtypid = $id ORDER BY enumsortorder");
return ($enums ? "'" . implode("', '", array_map('addslashes', $enums)) . "'" : "");
}
function schemas() {
return get_vals("SELECT nspname FROM pg_namespace ORDER BY nspname");
}