From e915f73f18dbd84e5f94513a28a6f4c7efecf093 Mon Sep 17 00:00:00 2001 From: Jakub Vrana Date: Mon, 8 Feb 2021 16:23:36 +0100 Subject: [PATCH] PostgreSQL: Fix multi-parameter functions in default values (bug #736) --- adminer/drivers/pgsql.inc.php | 2 +- changes.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 4895df0c..d6213b4d 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -380,7 +380,7 @@ ORDER BY a.attnum" $row["null"] = !$row["attnotnull"]; $row["auto_increment"] = $row['identity'] || preg_match('~^nextval\(~i', $row["default"]); $row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1); - if (preg_match('~(.+)::[^)]+(.*)~', $row["default"], $match)) { + if (preg_match('~(.+)::[^,)]+(.*)~', $row["default"], $match)) { $row["default"] = ($match[1] == "NULL" ? null : (($match[1][0] == "'" ? idf_unescape($match[1]) : $match[1]) . $match[2])); } $return[$row["field"]] = $row; diff --git a/changes.txt b/changes.txt index 186f852c..188969bb 100644 --- a/changes.txt +++ b/changes.txt @@ -5,6 +5,7 @@ Support PHP 8 in create table (regression from 4.7.9) MySQL 8: Fix EXPLAIN in SQL command PostgreSQL: Create PRIMARY KEY for auto increment columns PostgreSQL: Avoid exporting empty sequence last value (bug #768) +PostgreSQL: Fix multi-parameter functions in default values (bug #736) PostgreSQL PDO: Do not select NULL function for false values in edit Adminer 4.7.9 (released 2021-02-07):