duplicate key value violates unique constraint - but no such values

Viewed 859

Ran:

truncate table tableA restart identity CASCADE;

Inserted new constraint:

ALTER TABLE tableA ADD CONSTRAINT constraint UNIQUE (col1, col2);

Now get:

ERROR: duplicate key value violates unique constraint "constraint"
Key (col1, col2)=(123, "Monday") already exists

Even though there are no such combination

tableA also references(has foreign key column) to tableB which was not changed in any way.

Help appreciated.

1 Answers
Related