Postgres::createView PHP Метод

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

Creates a new view.
public createView ( $viewname, $definition, $replace, $comment )
$viewname The name of the view to create
$definition The definition for the new view
$replace True to replace the view, false otherwise
    function createView($viewname, $definition, $replace, $comment)
    {
        $status = $this->beginTransaction();
        if ($status != 0) {
            return -1;
        }
        $f_schema = $this->_schema;
        $this->fieldClean($f_schema);
        $this->fieldClean($viewname);
        // Note: $definition not cleaned
        $sql = "CREATE ";
        if ($replace) {
            $sql .= "OR REPLACE ";
        }
        $sql .= "VIEW \"{$f_schema}\".\"{$viewname}\" AS {$definition}";
        $status = $this->execute($sql);
        if ($status) {
            $this->rollbackTransaction();
            return -1;
        }
        if ($comment != '') {
            $status = $this->setComment('VIEW', $viewname, '', $comment);
            if ($status) {
                $this->rollbackTransaction();
                return -1;
            }
        }
        return $this->endTransaction();
    }
Postgres