[eluser]piotrpolak[/eluser]
It is not a reall bug.
I have got 2 tables:
Code:
CREATE TABLE table1 (
myid serial NOT NULL PRIMARY KEY
);
Code:
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:
Code:
ERROR: cannot truncate a table referenced in a foreign key constraint
Method truncate from CI_DB_postgre_driver:
Code:
function _truncate($table)
{
return "TRUNCATE ".$this->_escape_table($table);
}
Should/could be:
Code:
function _truncate($table)
{
return "TRUNCATE ".$this->_escape_table($table)." CASCADE"; // HERE!
}