Fix NULL value in edit form with Postgres

This commit is contained in:
Jáchym Toušek 2018-01-17 09:50:45 +01:00 committed by Jakub Vrana
parent 6a95b71164
commit 019ada8da5
2 changed files with 2 additions and 1 deletions

View file

@ -304,7 +304,7 @@ ORDER BY a.attnum"
$row["auto_increment"] = preg_match('~^nextval\\(~i', $row["default"]);
$row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1);
if (preg_match('~(.+)::[^)]+(.*)~', $row["default"], $match)) {
$row["default"] = ($match[1][0] == "'" ? idf_unescape($match[1]) : $match[1]) . $match[2];
$row["default"] = ($match[1] == "NULL" ? null : (($match[1][0] == "'" ? idf_unescape($match[1]) : $match[1]) . $match[2]));
}
$return[$row["field"]] = $row;
}

View file

@ -2,6 +2,7 @@ Adminer 4.4.1-dev:
Adminer: Fix Search data in tables (regression from 4.4.0)
CSP: Allow any images, media and fonts, disallow base-uri
SQLite: Enable foreign key checks
PostgreSQL: Respect NULL default value
Elasticsearch: Insert, update, delete
Adminer 4.4.0 (released 2018-01-17):