Postgres::createTablespace PHP Method

createTablespace() public method

Creates a tablespace
public createTablespace ( $spcname, $spcowner, $spcloc, $comment = '' )
$spcname The name of the tablespace to create
$spcowner The owner of the tablespace. '' for current
$spcloc The directory in which to create the tablespace
    function createTablespace($spcname, $spcowner, $spcloc, $comment = '')
    {
        $this->fieldClean($spcname);
        $this->clean($spcloc);
        $sql = "CREATE TABLESPACE \"{$spcname}\"";
        if ($spcowner != '') {
            $this->fieldClean($spcowner);
            $sql .= " OWNER \"{$spcowner}\"";
        }
        $sql .= " LOCATION '{$spcloc}'";
        $status = $this->execute($sql);
        if ($status != 0) {
            return -1;
        }
        if ($comment != '' && $this->hasSharedComments()) {
            $status = $this->setComment('TABLESPACE', $spcname, '', $comment);
            if ($status != 0) {
                return -2;
            }
        }
        return 0;
    }
Postgres