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

Respect PostgreSQL custom types

This commit is contained in:
Jakub Vrana
2010-05-21 15:07:59 +02:00
parent 84d068df8b
commit 4780703d17
6 changed files with 59 additions and 43 deletions

View File

@@ -131,9 +131,10 @@ function process_length($length) {
* @return string
*/
function process_type($field, $collate = "COLLATE") {
global $connection, $unsigned;
return " $field[type]"
. ($field["length"] != "" && !ereg('^date|time$', $field["type"]) ? "(" . process_length($field["length"]) . ")" : "")
global $types, $connection, $unsigned;
$type = $field["type"];
return " " . (isset($types[$type]) ? $type : idf_escape($type))
. ($field["length"] != "" ? "(" . process_length($field["length"]) . ")" : "")
. (ereg('int|float|double|decimal', $field["type"]) && in_array($field["unsigned"], $unsigned) ? " $field[unsigned]" : "")
. (ereg('char|text|enum|set', $field["type"]) && $field["collation"] ? " $collate " . $connection->quote($field["collation"]) : "")
;