Passa al contenuto
Menu
È necessario essere registrati per interagire con la community.
La domanda è stata contrassegnata
1 Rispondi
4066 Visualizzazioni

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!

Avatar
Abbandona
Risposta migliore

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

Avatar
Abbandona
Post correlati Risposte Visualizzazioni Attività
1
mag 25
2444
1
apr 25
3464
1
apr 25
4293
1
apr 25
1776
4
mar 25
6881