Postgres::alterTableTablespace PHP Method

alterTableTablespace() public method

Alter a table's tablespace !\ this function is called from _alterTable which take care of escaping fields
public alterTableTablespace ( $tblrs, $tablespace = null )
$tblrs The table RecordSet returned by getTable()
    function alterTableTablespace($tblrs, $tablespace = null)
    {
        /* vars cleaned in _alterTable */
        if (!empty($tablespace) && $tblrs->fields['tablespace'] != $tablespace) {
            $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}\".\"{$tblrs->fields['relname']}\" SET TABLESPACE \"{$tablespace}\"";
            return $this->execute($sql);
        }
        return 0;
    }
Postgres