Skip ke Konten
Menu
Pertanyaan ini telah diberikan tanda
1 Balas
4108 Tampilan

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
Buang
Jawaban Terbai

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
Buang
Post Terkait Replies Tampilan Aktivitas
1
Mei 25
2482
1
Apr 25
3490
1
Apr 25
4319
1
Apr 25
1793
4
Mar 25
6915