SQL to update table with records from second table (but only those with distinct value in a given column)
Use NOT EXISTS to check that no matching record already exists in t1 and the row_number() window function to pick only one row per t2.d.

INSERT INTO t1
            (a,
             b)
            SELECT x.d,
                   x.e
                   FROM (SELECT t21.d,
                                t21.e,
                                row_number() OVER (PARTITION BY t21.d) rn
                                FROM t2 t21
                                WHERE NOT EXISTS (SELECT *
                                                         FROM t1 t11
                                                         WHERE t11.a = t21.d)) x
                   WHERE x.rn = 1;


I don't know how t1.c should be calculated, that's not clear from your post. So I left this part out. But maybe this helps to solve the main problem.