📜  在 postgresql 中的“复制自”期间忽略重复键 - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:16.634000             🧑  作者: Mango

代码示例1
create temp table tmp_table on commit drop as select * from brand with no data;
copy tmp_table (name,slug) from '/var/lib/postgresql/data/Brands.csv' DELIMITER ',' csv header;
insert into brand select distinct on (slug) * from tmp_table;