postgresql添加数据时主键冲突

postgres=# SELECT setval('表名_id_seq', (SELECT max(id) FROM 表名));

原文地址:https://www.cnblogs.com/ghh520/p/13863968.html