PostgreSQL: Avoid exporting empty sequence last value

This commit is contained in:
Jakub Vrana 2021-02-08 14:12:39 +01:00
parent 9e74c0632f
commit 2bb472d7a6
2 changed files with 2 additions and 1 deletions

View file

@ -777,7 +777,7 @@ AND typelem = 0"
: "SELECT * FROM $sequence_name"
));
$sequences[] = ($style == "DROP+CREATE" ? "DROP SEQUENCE IF EXISTS $sequence_name;\n" : "")
. "CREATE SEQUENCE $sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value] START " . ($auto_increment ? $sq['last_value'] : 1) . " CACHE $sq[cache_value];";
. "CREATE SEQUENCE $sequence_name INCREMENT $sq[increment_by] MINVALUE $sq[min_value] MAXVALUE $sq[max_value]" . ($auto_increment && $sq['last_value'] ? " START $sq[last_value]" : "") . " CACHE $sq[cache_value];";
}
}

View file

@ -4,6 +4,7 @@ Add DB version to comment in export
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
PostgreSQL PDO: Do not select NULL function for false values in edit
Adminer 4.7.9 (released 2021-02-07):