From 22b42abc7047d5d2c9888d7a01f5d50eb5ab52a0 Mon Sep 17 00:00:00 2001 From: Sam Reed Date: Sun, 20 Nov 2011 17:54:47 +0000 Subject: [PATCH] * (bug 29635) update.php for Postgres creates sequences, then fails when it to rename sequences to those same names Patch by Luigi Corsaro --- includes/installer/PostgresUpdater.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/includes/installer/PostgresUpdater.php b/includes/installer/PostgresUpdater.php index ae96e488d7..48fc1505df 100644 --- a/includes/installer/PostgresUpdater.php +++ b/includes/installer/PostgresUpdater.php @@ -15,6 +15,11 @@ class PostgresUpdater extends DatabaseUpdater { + /** + * @var DatabasePostgres + */ + protected $db; + /** * @todo FIXME: Postgres should use sequential updates like Mysql, Sqlite * and everybody else. It never got refactored like it should've. @@ -390,6 +395,10 @@ END; } protected function renameSequence( $old, $new ) { + if ( $this->db->sequenceExists( $new ) ) { + $this->output( "WARNING sequence $new already exists\n" ); + return; + } if ( $this->db->sequenceExists( $old ) ) { $this->output( "Renaming sequence $old to $new\n" ); $this->db->query( "ALTER SEQUENCE $old RENAME TO $new" ); -- 2.20.1