]> git.joonet.de Git - adminer.git/commitdiff
PostgreSQL: Allow now() as default value (bug #525)
authorJakub Vrana <jakub@vrana.cz>
Tue, 30 Jan 2018 15:24:31 +0000 (16:24 +0100)
committerJakub Vrana <jakub@vrana.cz>
Tue, 30 Jan 2018 15:24:31 +0000 (16:24 +0100)
adminer/include/editing.inc.php
changes.txt

index 9c66ec55e043c2414251b5768b5f75b56daa8bd5..d0bf401bbd8b37a58adf1178999257597a37e1a3 100644 (file)
@@ -199,7 +199,7 @@ function process_field($field, $type_field) {
                process_type($type_field),
                ($field["null"] ? " NULL" : " NOT NULL"), // NULL for timestamp
                (isset($default) ? " DEFAULT " . (
-                       (preg_match('~time~', $field["type"]) && preg_match('~^CURRENT_TIMESTAMP(\(\))?$~i', $default))
+                       (preg_match('~time~', $field["type"]) && preg_match('~^(now\(\)|CURRENT_TIMESTAMP(\(\)))?$~i', $default))
                        || ($jush == "sqlite" && preg_match('~^CURRENT_(TIME|TIMESTAMP|DATE)$~i', $default))
                        || ($field["type"] == "bit" && preg_match("~^([0-9]+|b'[0-1]+')\$~", $default))
                        || ($jush == "pgsql" && preg_match("~^[a-z]+\\(('[^']*')+\\)\$~", $default))
index e4aed5022f3a4fd560721070c09e7143b965d502..2e1f7a641a3845511977e94270691e81dfd7d0e6 100644 (file)
@@ -4,6 +4,7 @@ PHP <5.3 compatibility even with Elasticsearch enabled
 MariaDB: Support JSON since MariaDB 10.2
 PostgreSQL: Support functions
 PostgreSQL: Allow editing views with uppercase letters (bug #467)
+PostgreSQL: Allow now() as default value (bug #525)
 SimpleDB: Document that allow_url_fopen is required
 Malay translation