Postgres::alterViewSchema PHP Method

alterViewSchema() public method

Alter a view's schema
public alterViewSchema ( $vwrs, $schema )
$vwrs The view recordSet returned by getView()
    function alterViewSchema($vwrs, $schema)
    {
        /* $vwrs and $schema are cleaned in _alterView */
        if (!empty($schema) && $vwrs->fields['nspname'] != $schema) {
            $f_schema = $this->_schema;
            $this->fieldClean($f_schema);
            // If tablespace has been changed, then do the alteration.  We
            // don't want to do this unnecessarily.
            $sql = "ALTER TABLE \"{$f_schema}\".\"{$vwrs->fields['relname']}\" SET SCHEMA \"{$schema}\"";
            return $this->execute($sql);
        }
        return 0;
    }
Postgres