diff --git a/adminer/drivers/pgsql.inc.php b/adminer/drivers/pgsql.inc.php index 4660e5ad..6f835cba 100644 --- a/adminer/drivers/pgsql.inc.php +++ b/adminer/drivers/pgsql.inc.php @@ -776,8 +776,6 @@ AND typelem = 0" } function create_sql($table, $auto_increment, $style) { - global $connection; - $return = ''; $return_parts = array(); $sequences = array(); @@ -812,8 +810,11 @@ AND typelem = 0" : "SELECT * FROM $sequence_name" ); $sq = reset($rows); - $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]" . ($auto_increment && $sq['last_value'] ? " START $sq[last_value]" : "") . " CACHE $sq[cache_value];"; + + $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]" . + ($auto_increment && $sq['last_value'] ? " START " . ($sq["last_value"] + 1) : "") . + " CACHE $sq[cache_value];"; } }