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:
@@ -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() {
|
||||
|
@@ -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");
|
||||
}
|
||||
|
Reference in New Issue
Block a user