/** * Drop one column * * Postgres < 7.3 can't do that on it's own, you need to supply the complete defintion of the new table, * to allow, recreating the table and copying the content over to the new table * @param string $tabname table-name * @param string $flds column-name and type for the changed column * @param string $tableflds complete defintion of the new table, eg. for postgres, default '' * @param array/ $tableoptions options for the new table see CreateTableSQL, default '' * @return array with SQL strings */ function DropColumnSQL($tabname, $flds, $tableflds = '', $tableoptions = '') { $has_drop_column = 7.3 <= (double) @$this->serverInfo['version']; if (!$has_drop_column && !$tableflds) { if ($this->debug) { ADOConnection::outp("DropColumnSQL needs complete table-definiton for PostgreSQL < 7.3"); } return array(); } if ($has_drop_column) { return ADODB_DataDict::DropColumnSQL($tabname, $flds); } return $this->_recreate_copy_table($tabname, $flds, $tableflds, $tableoptions); }
function DropColumnSQL($tabname, $flds) { if ($this->debug) { ADOConnection::outp("DropColumnSQL only works with PostgreSQL 7.3+"); } return ADODB_DataDict::DropColumnSQL($tabname, $flds) . "/* only works for PostgreSQL 7.3+ */"; }