I've made a mistake. I've updated a table without where... Fortunatelly I have a backup. I cant delete the table and restore it, because of foreign key restrictions... I want to save the original table as UPDATE statements to restore the values, ¿how can I do that?
Example:
UPDATE mytable
SET mytable.c1 = backup.c1, mytable.c2 = backup.c2,
FROM backup
WHERE mytable.id = backup.id;