数据库操作集合
将PG的Serial类型的值设置为当前最大值+1
SELECT setval(pg_get_serial_sequence('test', 'id'), coalesce(max(id),0) + 1, false) FROM test;
将PG的Serial类型的值设置为当前最大值+1
SELECT setval(pg_get_serial_sequence('test', 'id'), coalesce(max(id),0) + 1, false) FROM test;