SELECT setval('payments_id_seq', 21, true);

from SO