From: Jehan-Guillaume (ioguix) de Rorthais Date: Thu, 23 Feb 2012 18:16:23 +0000 (+0100) Subject: Fix bug where renaming a tablespace was leading to an error X-Git-Tag: REL_5-1-0~89 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=5a29e20e35f26abfd3ce9d97fd1282c1388b4a5f;p=phppgadmin.git Fix bug where renaming a tablespace was leading to an error When renaming a tablespace, it was renamed first, then a comment was set on its old name in the same xact, leading to an error and rollback. --- diff --git a/classes/database/Postgres.php b/classes/database/Postgres.php index 3856eaf0..d2c00603 100755 --- a/classes/database/Postgres.php +++ b/classes/database/Postgres.php @@ -7031,10 +7031,12 @@ class Postgres extends ADODB_base { if ($name != $spcname) { $sql = "ALTER TABLESPACE \"{$spcname}\" RENAME TO \"{$name}\""; $status = $this->execute($sql); - if ($status != 0) { - $this->rollbackTransaction(); - return -3; - } + if ($status != 0) { + $this->rollbackTransaction(); + return -3; + } + + $spcname = $name; } // Set comment if it has changed