Postgres::alterViewOwner PHP Method

alterViewOwner() public method

Alter a view's owner
public alterViewOwner ( $vwrs, $owner = null )
$vwrs The view recordSet returned by getView()
    function alterViewOwner($vwrs, $owner = null)
    {
        /* $vwrs and $owner are cleaned in _alterView */
        if (!empty($owner) && $vwrs->fields['relowner'] != $owner) {
            $f_schema = $this->_schema;
            $this->fieldClean($f_schema);
            // If owner has been changed, then do the alteration.  We are
            // careful to avoid this generally as changing owner is a
            // superuser only function.
            $sql = "ALTER TABLE \"{$f_schema}\".\"{$vwrs->fields['relname']}\" OWNER TO \"{$owner}\"";
            return $this->execute($sql);
        }
        return 0;
    }
Postgres