PostgreSQL: Fix definition of complex generated columns

This commit is contained in:
Jakub Vrana
2026-01-17 07:49:50 +00:00
parent 80f9278d34
commit cca4d26784
2 changed files with 2 additions and 1 deletions

View File

@@ -5,6 +5,7 @@
- PostgreSQL: Allow creating NOT DEFERRABLE foreign keys
- PostgreSQL: Remove duplicate DEFERRABLE in foreign key export
- PostgreSQL: Add schema to sequence and and view export
- PostgreSQL: Fix definition of complex generated columns
- PostgreSQL: Mark unique partial indexes as unique (bug #1172)
- ClickHouse: Fix offset (bug #1188)
- ClickHouse: Fix list of tables (bug #1176)

View File

@@ -519,7 +519,7 @@ ORDER BY a.attnum") as $row
$row["auto_increment"] = $row['attidentity'] || preg_match('~^nextval\(~i', $row["default"])
|| preg_match('~^unique_rowid\(~', $row["default"]); // CockroachDB
$row["privileges"] = array("insert" => 1, "select" => 1, "update" => 1, "where" => 1, "order" => 1);
if (preg_match('~(.+)::[^,)]+(.*)~', $row["default"], $match)) {
if (!$row['generated'] && preg_match('~(.+)::[^,)]+(.*)~', $row["default"], $match)) {
$row["default"] = ($match[1] == "NULL" ? null : idf_unescape($match[1]) . $match[2]);
}
$return[$row["field"]] = $row;