It is not a reall bug.
I have got 2 tables:
CREATE TABLE table1 (
myid serial NOT NULL PRIMARY KEY
);
CREATE TABLE table2 (
myid int NOT NULL REFERENCES table1(myid) MATCH SIMPLE
ON UPDATE CASCADE ON DELETE CASCADE,
);
Lets suppose table2 is empty, and we try to truncate table1. This is what we get:
ERROR: cannot truncate a table referenced in a foreign key constraint
Method truncate from CI_DB_postgre_driver:
function _truncate($table)
{
return "TRUNCATE ".$this->_escape_table($table);
}
Should/could be:
function _truncate($table)
{
return "TRUNCATE ".$this->_escape_table($table)." CASCADE"; // HERE!
}
