PostgreSQL insert record by trigger
assuming ID is a primary key.

on conflict do nothing:

create or replace function t2_tab() returns trigger
as
$$declare r record;
begin
insert into tab2                                 
select new.*
on conflict do nothing
returning * into r;
return r;    
end;                
$$ language plpgsql;