How do I uniquely update values of a text column before applying UNIQUE constraint?
Ended up writing a nested loop which will select all duplicate entries in table dup_table and add a dash to each duplicate dup_name field until no duplicate records exist.

DO $$DECLARE 
  tmpRec RECORD; tmpInt INTEGER;
BEGIN
    LOOP
      tmpInt := 0;    

      FOR tmpRec IN 
        SELECT x_id FROM (
          SELECT x_id, ROW_NUMBER()
          OVER (PARTITION BY dup_name) AS "dup"
          FROM dup_table
        ) x WHERE "dup" &gt; 1 
      LOOP
        tmpInt := 1;

        UPDATE dup_table SET dup_name = dup_name || '-' WHERE x_id = tmpRec.x_id;

      END LOOP;

      EXIT WHEN tmpInt = 0;
    END LOOP;
END$$;