83
Views
4
Comments
'Duplicate key value violates unique constraint...' even though it is deleted

Hello, 

I'm confused as to why there is still a 'Duplicate key value violates unique constraint..' popping up even though we deleted the index we created in the entity already and the data are unique. It worked when we deleted all the record but we can't do that again and again. Please see the image below. How do we solve this? Does this happen also in OS11? Thank you.


UserImage.jpg
Alexandre Yip

Hi Matanong,

Check all the existing indexes with unique Yes, when this flag is set it means that data for the attribute must be unique. I believe you have indexes with this setting to true which are not allowing you to create records.

Regards


2023-05-02 10-33-02
Madhuri Patil

Hey @Matanong ,

Check the Schema of our Db table/entity you can get details where is the unique key constraint applied. 


Thanks,

Madhuri



UserImage.jpg
Matanong

I checked that already. Besides the auto index, which is not unique, there are no other unique in here because we deleted it already.

2021-11-12 04-59-31
Manikandan Sambasivam

The error message "Duplicate key value violates unique constraint" indicates that a unique constraint or index is still present, causing the issue. Despite deleting an index, other constraints at the database level might still be triggering this error. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.