Postgres::alterDatabaseRename PHP Method

alterDatabaseRename() public method

Renames a database, note that this operation cannot be performed on a database that is currently being connected to
public alterDatabaseRename ( string $oldName, string $newName ) : integer
$oldName string name of database to rename
$newName string new name of database
return integer 0 on success
    function alterDatabaseRename($oldName, $newName)
    {
        $this->fieldClean($oldName);
        $this->fieldClean($newName);
        if ($oldName != $newName) {
            $sql = "ALTER DATABASE \"{$oldName}\" RENAME TO \"{$newName}\"";
            return $this->execute($sql);
        } else {
            //just return success, we're not going to do anything
            return 0;
        }
    }
Postgres