Hi there,
I've a table with two columns are a unique key together and i cannot change the schema.
I'm trying to execute an update using psql in which i change the value of one of the column that are key. The script is similar to the following:
BEGIN;
UPDATE t1 SET P1='23' where P1='33';
UPDATE t1 SET P1='23' where P1='55';
COMMIT;
Using psql with the command:
psql -U user -f file
I've got the error
ERROR: duplicate key violates unique constraint "<key_name>"
But the column is in key with another column and changing it doesn't "break" any unique constraint. The same query inside pgAdmin3 runs fine with no errors.
I'm not a dba it seems to me that i'm missing something obvious.
Thanks