To ignore duplicate keys during 'copy from' in postgresql

前端 未结 4 885
天命终不由人
天命终不由人 2020-12-07 14:11

I have to dump large amount of data from file to a table PostgreSQL. I know it does not support \'Ignore\' \'replace\' etc as done in MySql. Almost all posts regarding this

4条回答
  •  星月不相逢
    2020-12-07 14:34

    Insert into a temp table grouped by the key so you get rid of the duplicates

    and then insert if not exists

提交回复
热议问题