Postgres::alterTablespace PHP Метод

alterTablespace() публичный Метод

Alters a tablespace
public alterTablespace ( $spcname, $name, $owner, $comment = '' ) : -4
$spcname The name of the tablespace
$name The new name for the tablespace
$owner The new owner for the tablespace
Результат -4
    function alterTablespace($spcname, $name, $owner, $comment = '')
    {
        $this->fieldClean($spcname);
        $this->fieldClean($name);
        $this->fieldClean($owner);
        // Begin transaction
        $status = $this->beginTransaction();
        if ($status != 0) {
            return -1;
        }
        // Owner
        $sql = "ALTER TABLESPACE \"{$spcname}\" OWNER TO \"{$owner}\"";
        $status = $this->execute($sql);
        if ($status != 0) {
            $this->rollbackTransaction();
            return -2;
        }
        // Rename (only if name has changed)
        if ($name != $spcname) {
            $sql = "ALTER TABLESPACE \"{$spcname}\" RENAME TO \"{$name}\"";
            $status = $this->execute($sql);
            if ($status != 0) {
                $this->rollbackTransaction();
                return -3;
            }
            $spcname = $name;
        }
        // Set comment if it has changed
        if (trim($comment) != '' && $this->hasSharedComments()) {
            $status = $this->setComment('TABLESPACE', $spcname, '', $comment);
            if ($status != 0) {
                return -4;
            }
        }
        return $this->endTransaction();
    }
Postgres