SELECT setval(pg_get_serial_sequence('users', 'id'), coalesce(max(id)+1, 1), false) FROM users;
SELECT setval('the_primary_key_sequence', (SELECT MAX(the_primary_key) FROM the_table)+1);
SELECT setval('tableName_id_seq', max(id)) FROM gst_codes;
# Reset the counter of a table named yourTable to start at id # 1453
ALTER SEQUENCE yourTable_id_seq RESTART WITH 1453
INSERT INTO blog
VALUES (1,'AWS Blog1')
ON CONFLICT DO NOTHING;
INSERT 0 0