"ERROR:  duplicate key value violates unique constraint" on an index.

Eli, when I looked at the link it didn’t seem to match to me. I’ll look at it again when I get back to work.

John, there are no duplicates. I know the employee ID to be unique. But I do see what your saying about the arrangement in general.

Zane, just a word of warning, having done a lot of work with employee records in the past. HR will often tell you that those employee ids are unique, but they’re often not. Take the SSN system in the United States for example. What happens if a person comes to work for you that doesn’t have one, as in they don’t have citizen status and only have a workers visa? Most HR people I’ve run into will just make one up, thinking "we’ll fix that later. " I used to see 999-99-9999 and 123-45-6789 all the time, for every record that was “unknown” . That may not be your case here, but just wanted to pass on some experience from someone who’s been there.

Oh I’ve been around long enough to learn that the hard way, and have to deal with it. More than once. And it’s coming again. Now I want to go home and crawl into bed.

I know for certain that employee ID is being generated by the source system, not a human and must be unique. I have verified the data from the source and know this to be true.

[quote=200377:@Zane Reinbold]Oh I’ve been around long enough to learn that the hard way, and have to deal with it. More than once. And it’s coming again. Now I want to go home and crawl into bed.

I know for certain that employee ID is being generated by the source system, not a human and must be unique. I have verified the data from the source and know this to be true.[/quote]
I was not trying to be mean, just to relay an experience with this sort of thing.

Eli, my primary key’s sequence (field name “ID”) is not out of sync with the content of the field. The problem field is “Employee_ID” and it’s not the field having the problem, it’s the index. The field and it’s index were marked unique.

While I am curious about this problem it goes away when I remove the unique constraint on the index of Employee_ID. It’s not a big deal, it just seems to me that it shouldn’t happen. At some point I will connect to the dev copy via ODBC to see if that changes anything but for now I have to prepare for going high-availability on one of our systems.

Thanks to everyone sending ideas my way. Eli, I will watch for the sync issue with sequences now that I know that can happen and how to fix it.