Commit 5750cad1 authored by lpsolit%gmail.com's avatar lpsolit%gmail.com

Bug 352967: [PostgreSQL] Changing a DB column type to "serial" is broken on…

Bug 352967: [PostgreSQL] Changing a DB column type to "serial" is broken on PostgreSQL 8.1 - Patch by Rémi Zara <remi_zara@mac.com> r=mkanat a=myk
parent cc3a19cb
......@@ -120,7 +120,8 @@ sub _get_alter_type_sql {
if ($new_def->{TYPE} =~ /serial/i && $old_def->{TYPE} !~ /serial/i) {
push(@statements, "CREATE SEQUENCE ${table}_${column}_seq");
push(@statements, "SELECT setval('${table}_${column}_seq',
MAX($table.$column))");
MAX($table.$column))
FROM $table");
push(@statements, "ALTER TABLE $table ALTER COLUMN $column
SET DEFAULT nextval('${table}_${column}_seq')");
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment