INSERT INTO labels
SELECT DISTINCT on (labeler, label, uri) *
FROM label_tmp
ON CONFLICT (labeler, label, uri) DO UPDATE
    SET negated=EXCLUDED.negated,
        expires=EXCLUDED.expires,
        sig=EXCLUDED.sig,
        created_at=excluded.created_at