Código SQL:
Ver originalDROP TABLE a1_source;
CREATE TABLE a1_source (source_id,source_name)
AS
SELECT test_seq.NEXTVAL, source_name FROM
(SELECT DISTINCT source_name source_name FROM a1_metadata);
ALTER TABLE a1_source ADD CONSTRAINT pk_a1_source PRIMARY KEY(source_id);
Así?