[TYPO3-dev] How standard compliant is "truncate"?

Martin Kutschker masi-no at spam-typo3.org
Thu Feb 12 19:21:42 CET 2009


Peter Kuehn [wmdb] schrieb:
> Hi yall,
> 
> some questions to those, who know more about databases than i do:
> 
> How standard compliant is "truncate table"?
> On which DBMS will it work or not work?
> Is ADODB able to rewrite it where it does not work?
> 
> Background:
> I plan to submit a patch request for t3lib_tcemain->clear_cacheCmd()
> where $cacheCmd=='all', if truncate table will not break DBAL.
> The currently used "DELETE FROM cache_*" calls end up as an entry in
> slow query logs on larger installs.

Taken from the docs for Oracle 11g Rel. 1

"You cannot truncate the parent table of an enabled foreign key
constraint. You must disable the constraint before truncating the table.
An exception is that you can truncate the table if the integrity
constraint is self-referential."

And Oracle's implementation allows only ONE table to be truncated at once.

Masi




More information about the TYPO3-dev mailing list