Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Update auto generated primary key with custom primary key

Avatar

Avatar
Level 1
Ponmurugesh
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
Ponmurugesh
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
Ponmurugesh
Level 1

27-01-2021

Hi,

We are migrating our logs from On-prem adobe campaign classic instance to hosted adobe campaign classic instance. in that process we are facing an issue while updating the auto generated primary key of tracking log schema with our existing on-prem primary key of tracking logs. we are updating this by using dataloading activity and updating the primary key with the help of foreign key of deliveryId and foreign key of urlId, we are facing the following error "PGS-220000 PostgreSQL error: ERROR: duplicate key value violates unique constraint "nmstrackinglogrcp_id" DETAIL: Key (itrackinglogid)=('1234567') already exists."

 

Kindly help us to resolve the issue

 

Thanks!!

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
wodnicki
MVP

Likes

938 likes

Total Posts

1,061 posts

Correct Reply

495 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile

Avatar
Contributor
MVP
wodnicki
MVP

Likes

938 likes

Total Posts

1,061 posts

Correct Reply

495 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile
wodnicki
MVP

01-02-2021

Hi,

 

Find the highest ID in the table:

select max(itrackinglogid) from nmstrackinglogrcp;

 

Then update sequence to start 1 higher:

alter sequence NmsTrackingLogId restart with 9000;

 

Thanks,

-Jon

 

Answers (0)