pgsql批量新增覆盖原表数据

insert into table_name(sort_type,sort_desc,sort_content,create_time, update_time) VALUES %s
                                      ON CONFLICT (sort_type)  DO UPDATE SET
(sort_desc,sort_content,update_time) = (EXCLUDED.sort_desc,EXCLUDED.sort_content,EXCLUDED.create_time)

# 唯一索引为:sort_type

posted @ 2022-06-16 18:18  阿磊小哥哥呀  阅读(712)  评论(0编辑  收藏  举报