mirror of
https://github.com/vrana/adminer.git
synced 2026-03-24 21:40:03 +01:00
PostgreSQL: Export serial as serial, not nextval()
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
- Foreign key: Display new field in case of an error
|
||||
- PostgreSQL: Order NULL last
|
||||
- PostgreSQL: Display all SQL command warnings and only once
|
||||
- PostgreSQL: Export serial as serial, not nextval()
|
||||
- PostgreSQL: Export schema in nextval()
|
||||
- PostgreSQL: Export schema in REFERENCES
|
||||
- Editor: Display tinyint(1) as checkbox (bug #1246, regression from 5.4.2)
|
||||
|
||||
@@ -946,6 +946,11 @@ AND typelem = 0"
|
||||
|
||||
// fields' definitions
|
||||
foreach ($fields as $field) {
|
||||
if ($field['default'] == "nextval('$status[Name]_$field[field]_seq')") {
|
||||
$field['default'] = null;
|
||||
$field['full_type'] = preg_replace('~int(eger)?~', 'serial', $field['full_type']);
|
||||
}
|
||||
|
||||
$part = idf_escape($field['field']) . ' ' . $field['full_type']
|
||||
. preg_replace('~(nextval\(\')([^.\']+\')~', '\1' . str_replace("'", "''", $status['nspname']) . '.\2', default_value($field))
|
||||
. ($field['null'] ? "" : " NOT NULL");
|
||||
|
||||
Reference in New Issue
Block a user