1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-09 16:17:48 +02:00

PostgreSQL: Support creating array columns

Also allow () in length and IN.
This commit is contained in:
Jakub Vrana
2013-08-06 15:48:45 -07:00
parent 9ffca2f6e6
commit 2e245412dc
5 changed files with 11 additions and 9 deletions

View File

@@ -271,12 +271,11 @@ AND a.attnum > 0
ORDER BY a.attnum"
) as $row) {
//! collation, primary
$type = $row["full_type"];
if (preg_match('~(.+)\\((.*)\\)$~', $row["full_type"], $match)) {
list(, $type, $row["length"]) = $match;
}
preg_match('~([^([]+)(\((.*)\))?((\[[0-9]*])*)$~', $row["full_type"], $match);
list(, $type, $length, $row["length"], $array) = $match;
$row["length"] .= $array;
$row["type"] = ($aliases[$type] ? $aliases[$type] : $type);
$row["full_type"] = $row["type"] . ($row["length"] ? "($row[length])" : "");
$row["full_type"] = $row["type"] . $length . $array;
$row["null"] = !$row["attnotnull"];
$row["auto_increment"] = preg_match('~^nextval\\(~i', $row["default"]);
$row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1);