When we upgrade magento version then sometimes we faced below error while setup upgrade command run.

SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ‘227569538’ for key ‘catalog_url_rewrite_product_category.PRIMARY’, query was: ALTER TABLE `catalog_url_rewrite_product_category` ADD CONSTRAINT  PRIMARY KEY (`url_rewrite_id`), DEFAULT CHARSET=’utf8′, DEFAULT COLLATE=’utf8_general_ci’

We can fix above error by delete all duplicate records:

Here is query for delete duplicate records.

SQL
DELETE t1.* FROM catalog_url_rewrite_product_category t1 INNER JOIN (SELECT url_rewrite_id FROM catalog_url_rewrite_product_category GROUP BY url_rewrite_id HAVING COUNT(*)>1) t2 ON t1.url_rewrite_id = t2.url_rewrite_id

I hope this blog is useful to solve Duplicate entry for table ‘catalog_url_rewrite_product_category. In case, I missed anything or need to add some more information, Don’t heisted to leave a comment in this blog, I’ll get back with some positive approach.

Keep loving ❤️ Keep inspiring 🤩 Keep liking 👍 No sharing 😂

19 Comments

  1. Your point of view caught my eye and was very interesting. Thanks. I have a question for you.

  2. Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

  3. Thank you for your sharing. I am worried that I lack creative ideas. It is your article that makes me full of hope. Thank you. But, I have a question, can you help me?

  4. When it comes to roof installation in Lancaster, Roof Installation Pros stands out for quality and reliability. Their expert team works with all roof types, delivering strong, protective installations that add value. Highly rated for affordable, on-time, and professional roofing work.

  5. For dependable and expert roof installation services in Lancaster, Roof Installation Pros is your go-to choice. They specialize in all roofing types, delivering lasting solutions that safeguard your property and boost its value. Count on them for affordable, high-quality, and on-time service.

  6. For dependable and expert roof installation services in Lancaster, Roof Installation Pros is your go-to choice. They specialize in all roofing types, delivering lasting solutions that safeguard your property and boost its value. Count on them for affordable, high-quality, and on-time service.

  7. Get reliable roof installation services in Lancaster with Roof Installation Pros. Whether it’s a new roof or a replacement, their experienced crew delivers quality craftsmanship that lasts. Known for fair pricing and dependable results that boost home value—your roof is in safe hands.

  8. Need top-notch roof installation in Lancaster? Roof Installation Pros delivers professional services with a skilled team ready to handle all roof types. Their work is reliable, durable, and adds value to your home—trusted by many for timely and budget-friendly roofing solutions.

Write A Comment