mirror of
https://github.com/vrana/adminer.git
synced 2025-08-10 16:44:17 +02:00
PostgreSQL: Fix exporting CREATE TABLE query with GENERATED default values
Thanks to GottfriedCP (https://github.com/adminerevo/adminerevo/issues/157)
This commit is contained in:
@@ -238,7 +238,10 @@ function process_field($field, $type_field) {
|
||||
*/
|
||||
function default_value($field) {
|
||||
$default = $field["default"];
|
||||
return ($default === null ? "" : " DEFAULT " . (preg_match('~char|binary|text|enum|set~', $field["type"]) || preg_match('~^(?![a-z])~i', $default) ? q($default) : $default));
|
||||
return ($default === null ? "" : " DEFAULT " .
|
||||
(!preg_match('~^GENERATED ~i', $default) && (preg_match('~char|binary|text|enum|set~', $field["type"]) || preg_match('~^(?![a-z])~i', $default))
|
||||
? q($default) : $default)
|
||||
);
|
||||
}
|
||||
|
||||
/** Get type class to use in CSS
|
||||
|
Reference in New Issue
Block a user