diff options
author | lpsolit%gmail.com <> | 2006-09-18 22:49:04 +0200 |
---|---|---|
committer | lpsolit%gmail.com <> | 2006-09-18 22:49:04 +0200 |
commit | 5750cad16151bf7ad028f7dc79a8ab39b2f9a07a (patch) | |
tree | a72f9266557a857f8f2206a8c1607ae45a69a8f4 /Bugzilla/DB/Schema | |
parent | cc3a19cb43e162ede1237986ea535a42c03cb423 (diff) | |
download | bugzilla-5750cad16151bf7ad028f7dc79a8ab39b2f9a07a.tar.gz bugzilla-5750cad16151bf7ad028f7dc79a8ab39b2f9a07a.tar.xz |
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
Diffstat (limited to 'Bugzilla/DB/Schema')
-rw-r--r-- | Bugzilla/DB/Schema/Pg.pm | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Bugzilla/DB/Schema/Pg.pm b/Bugzilla/DB/Schema/Pg.pm index 09e3bfbd4..21b0c6d96 100644 --- a/Bugzilla/DB/Schema/Pg.pm +++ b/Bugzilla/DB/Schema/Pg.pm @@ -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')"); } |