I have a sql constrain that is set up for one of my model. Recently, I have been getting duplication messages even though there is no duplication:
psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "purchase_order_unique_mail_order"
DETAIL: Key (purcahse_shop_id, mail_id,mail_purcha_id)=(1, 5208, 65) already exists.
No such duplication exists. I ran queries to search for this and it does not exist.
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Comptabilité
- Inventaire
- PoS
- Project
- MRP
Cette question a été signalée
Hi,
You can trust the postgresql constrains, it wont raise without meeting the given condition. So here some how the constrains is triggered, may be the duplicate values get generated on the current commit/fly and on writing it to the db it is getting failed and as it roll backed to its original state you may not be able to find the duplicated value.
In order to trace it, you can try with api constrains and see by adding some print/logger inside it to trace it.
Thanks
Vous appréciez la discussion ? Ne vous contentez pas de lire, rejoignez-nous !
Créez un compte dès aujourd'hui pour profiter de fonctionnalités exclusives et échanger avec notre formidable communauté !
S'inscrirePublications associées | Réponses | Vues | Activité | |
---|---|---|---|---|
|
5
août 24
|
15612 | ||
|
2
juil. 24
|
2137 | ||
|
4
févr. 24
|
3275 | ||
|
1
févr. 24
|
2264 | ||
|
0
août 21
|
111 |