diff --git a/code/PostgreSQLDatabase.php b/code/PostgreSQLDatabase.php index f376035..b4fcedc 100644 --- a/code/PostgreSQLDatabase.php +++ b/code/PostgreSQLDatabase.php @@ -1365,6 +1365,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 *