]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL: Fix timestamp(0) (fixes #383)
authorLubor Bilek <bilek@wdw.cz>
Thu, 10 Jul 2014 10:26:04 +0000 (12:26 +0200)
committerJakub Vrana <jakub@vrana.cz>
Mon, 15 Sep 2014 04:34:26 +0000 (21:34 -0700)
adminer/drivers/pgsql.inc.php

index 6ede66cdc1df30aee0a11f40aa3a7cc58796bee6..9b7a13a1ac6c0f1cc9327a6fb04a7bacada7717c 100644 (file)
@@ -280,11 +280,17 @@ AND a.attnum > 0
 ORDER BY a.attnum"
                ) as $row) {
                        //! collation, primary
-                       preg_match('~([^([]+)(\((.*)\))?((\[[0-9]*])*)$~', $row["full_type"], $match);
-                       list(, $type, $length, $row["length"], $array) = $match;
+                       preg_match('~([^([]+)(\((.*)\))?([a-z ]+)?((\[[0-9]*])*)$~', $row["full_type"], $match);
+                       list(, $type, $length, $row["length"], $addon, $array) = $match;
                        $row["length"] .= $array;
-                       $row["type"] = ($aliases[$type] ? $aliases[$type] : $type);
-                       $row["full_type"] = $row["type"] . $length . $array;
+                       $check_type = $type . $addon;
+                       if (isset($aliases[$check_type])) {
+                               $row["type"] = $aliases[$check_type];
+                               $row["full_type"] = $row["type"] . $length . $array;
+                       } else {
+                               $row["type"] = $type;
+                               $row["full_type"] = $row["type"] . $length . $addon . $array;
+                       }
                        $row["null"] = !$row["attnotnull"];
                        $row["auto_increment"] = preg_match('~^nextval\\(~i', $row["default"]);
                        $row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1);