Skip to content

Commit

Permalink
Fix bug where renaming a tablespace was leading to an error
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ioguix committed Feb 23, 2012
1 parent 7bf05b8 commit 5a29e20
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions classes/database/Postgres.php
Expand Up @@ -7031,10 +7031,12 @@ function alterTablespace($spcname, $name, $owner, $comment='') {
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
Expand Down

0 comments on commit 5a29e20

Please sign in to comment.