you cant conditionnaly COPY
table from file. what you can do instead:
create table t (a1 text, a2 text, a3 text);
COPY t from file;
update t set a1 = null where a1 !~ '^d{1,}$';
alter table t alter column a1 type int using a1::int;
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…