Changing Postgresql to use DELETE FROM instead of TRUNCATE.

This should improve compatibilty with databases using constraints.
Fixes #1838
This commit is contained in:
mark_story 2011-07-28 22:17:12 -04:00
parent ecccfe913b
commit e1960d1d35

View file

@ -403,7 +403,7 @@ class DboPostgres extends DboSource {
* @access public * @access public
*/ */
function truncate($table, $reset = 0) { function truncate($table, $reset = 0) {
if (parent::truncate($table)) { if ($this->execute('DELETE FROM ' . $this->fullTableName($table))) {
$table = $this->fullTableName($table, false); $table = $this->fullTableName($table, false);
if (isset($this->_sequenceMap[$table]) && $reset !== 1) { if (isset($this->_sequenceMap[$table]) && $reset !== 1) {
foreach ($this->_sequenceMap[$table] as $field => $sequence) { foreach ($this->_sequenceMap[$table] as $field => $sequence) {