There is an error that I am running across but am unable to repeat on a simple schema. If anyone can point me in the right direction to collect more details, I would be happy to look.
The problem arises when attempting to add a unique key on two columns with the following:
This results in a duplicate entry error:
`Duplicate entry 'Yageo-RC0805FR-071ML' for key 'manufacturer_pn_UN'
In an effort to find the problem, I searched for everything that matched the problematic key:
Results of the command:
Note that none of these rows are active, so there should be no violation. This leads me to think that adding the unique constraint is running a check on historical rows, which it shouldn't. Setting `check_constraint_checks` to 0 also has no effect, and adding the key still fails.
As mentioned, I would be happy to dig deeper to try to find the cause since I can't seem to replicate this issue on table from scratch.