test1
id
name
test2
id
test_id
type
name_test2
insert into test2 (test_id, type)
select test.id, type_value from test1
join (
select 1 as type_value
union all
select 2
) as types ON TRUE -- нужно декартово произведение
where not exists (select 1 from test2 where test2.test_id = test.id)