Skip to Content
Menu
This question has been flagged
1 Atsakyti
4060 Rodiniai

Good day,

after removal of a module, i cant install a new module and i get the following message:

The operation cannot be completed: duplicate key value violates unique constraint "res_partner_pkey"

DETAIL:  Key (id)=(113) already exists.


So ive tried to figure out how to fix it including 

ALTER SEQUENCE res_partner_id_seq RESTART WITH 300;


Is there anyone that can possibly tell me what im supposed to check or change to changes it so a new module will start on a different index?


Thank you!

Portretas
Atmesti
Best Answer

Hi,

Identify the conflict:
You need to determine why there is a conflict with the value 113 in the "id" column. This could be due to a previous record that wasn't properly removed or some other issue. You should find out which record has an "id" of 113.

Resolve the conflict:
Once you've identified the conflicting record, you'll need to decide how to resolve it. You might need to delete the conflicting record if it's no longer needed or update it to have a different "id" value.

Restart the sequence:
If you've deleted the conflicting record and want to start the sequence from a different index, you can use the ALTER SEQUENCE command as you mentioned. For example, if you want to start the sequence from 300, you can execute the  SQL command


Hope it helps

Portretas
Atmesti
Related Posts Replies Rodiniai Veikla
1
geg. 25
2441
1
bal. 25
3463
1
bal. 25
4287
1
bal. 25
1774
4
kov. 25
6875