postgresql resolv duplicate value violates unique constraint
snippet in sql

postgresql resolv duplicate value violates unique constraint

user4787

SELECT setval(pg_get_serial_sequence('users', 'id'), coalesce(max(id)+1, 1), false) FROM users;