Skip to content

Integrity constraint violation: 1062 Duplicate entry ‘3-2-9’ for key ‘PRIMARY’, query was: ALTER TABLE `catalog_category_product_index_tmp`

Integrity constraint violation: 1062 Duplicate entry ‘3-2-9’ for key ‘PRIMARY’, query was: ALTER TABLE catalog_category_product_index_tmp ADD CONSTRAINT PRIMARY KEY (category_id,product_id,store_id), COMMENT=’Catalog Category Product Indexer temporary table’
enter image description here

this error comes when I run the setup:upgrade command in Magento 2
please make some suggestions to get rid of this error