This commit is contained in:
Stig Lindqvist 2013-06-05 18:47:36 -07:00
commit abffe37de8
1 changed files with 14 additions and 0 deletions

View File

@ -1369,6 +1369,20 @@ class PostgreSQLDatabase extends SS_Database {
return false;
}
/**
* Delete all entries from the table instead of truncating it.
*
* This gives a massive speed improvement compared to using TRUNCATE, with
* the caveat that primary keys are not reset etc.
*
* @see DatabaseAdmin::clearAllData()
*
* @param string $table
*/
public function clearTable($table) {
$this->query('DELETE FROM "'.$table.'";');
}
/**
* Return a boolean type-formatted string
*