will trillich <will(at)serensoft(dot)com> writes:
> in trying to UPDATE a linking-table record (the middle-man in a
> many-to-many relationship) i've encountered an "ERROR: Cannot
> insert a duplicate key into unique index _relations_p_r_v_ix"
I tried to duplicate this, and got:
...
regression-# relation.relative = r.id AND r.lname = 'b' and
regression-# relation.relation_v = t.id AND t.name = 'Family';
UPDATE 1
regression=#
I think there's something you left out.
Given that you tested the WHERE clause by making an equivalent SELECT,
I don't believe that the UPDATE is trying to update more than one row.
It seems more likely that you overlooked a uniqueness conflict against
some other existing row.
regards, tom lane