Answers for "duplicate key value violates unique constraint in postgresql"

SQL
2

postgresql resolv duplicate value violates unique constraint

SELECT setval(pg_get_serial_sequence('users', 'id'), coalesce(max(id)+1, 1), false) FROM users;
Posted by: Guest on December-16-2020
2

duplicate key value violates unique constraint in postgresql

SELECT setval('tableName_id_seq', max(id)) FROM gst_codes;
Posted by: Guest on September-30-2021

Code answers related to "duplicate key value violates unique constraint in postgresql"

Code answers related to "SQL"

Browse Popular Code Answers by Language