PostgreSQL: Add IF EXISTS to DROP SEQUENCE in export (bug #595)

This commit is contained in:
Jakub Vrana 2018-02-09 22:11:27 +01:00
parent daa19b0a6e
commit 879963dec1
2 changed files with 2 additions and 1 deletions

View file

@ -715,7 +715,7 @@ AND typelem = 0"
? "SELECT *, cache_size AS cache_value FROM pg_sequences WHERE schemaname = current_schema() AND sequencename = " . q($sequence_name)
: "SELECT * FROM $sequence_name"
));
$sequences[] = ($style == "DROP+CREATE" ? "DROP SEQUENCE $sequence_name;\n" : "")
$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];";
}
}

View file

@ -4,6 +4,7 @@ Shorten JSON values in select (bug #594)
Speed up alter table (regression from 4.4.0)
PostgreSQL: Fix exporting string default values
PostgreSQL: Fix exporting sequences in PostgreSQL 10
PostgreSQL: Add IF EXISTS to DROP SEQUENCE in export (bug #595)
Adminer 4.6.1 (released 2018-02-09):
Sticky position of table actions