SQL error after using Feeds Import with Taxonomies I have been using intensively the Feeds module. After many imports of data doing test, I sometimes get the following error message: ´SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry taxonomy_term-32591-0-0-und' for key 'PRIMARY'

Can I clean the database in such a way that I will no longer have this error message? Of course, when it happens, the taxonomy terms are not imported. After deleting the Feeds and importing again, it goes perfect, but the problem happens from time to time.

I don't think I have many extra modules which will store taxonomy tid's on them, so maybe the problem is with the core database tables, but I cannot find where there are still rows to be deleted manually to solve the problem.

Because the data are already corrupted, I pretend to manually repair the integrity of database (or with the help of a module) without having to look for a previous backup, which would imply losing hours of work done on other sections (and thus tables of the database).
Finally, I have discovered the problem. I deleted the taxonomy data with the module Taxonomy Manager. When importing the data with Feeds again, it believes that the data remains there, even if they longer no exists. From here, some failed imports can make database corrupted.

To regain integrity, I looked for the problem tid, and checked that it appears in field_data_* with entity_type = 'taxonomy_term' and field_revision_* with the same entity_type. I also appears in url_alias, and didn't find any more instance of tid's with the problems in any more tables. I truncated all these tables.

I also checked that both modules, when deleting taxonomy terms, if the tables are empty, they don't make an additional TRUNCATE, so the new tid's don't start at tid = 1.