Comparing two tables for a UUID change and fix it
UPDATE tbl_a a
SET    uuid = b.uuid
FROM   tbl_b b
WHERE  b.template_folder_uuid_parent = a.template_folder_uuid_parent
AND    b.heading = a.heading
AND    b.uuid &lt;&gt; a.uuid


The last line is to avoid empty updates, which are often forgotten and can be very expensive with big tables.

I would first verify that this update does what you expect it to do before you apply it:

SELECT *
FROM   tbl_a a
JOIN   tbl_b b ON
       b.template_folder_uuid_parent = a.template_folder_uuid_parent
AND    b.heading = a.heading
AND    b.uuid &lt;&gt; a.uuid;