I’m trying to set a sequence to a specific value.

SELECT setval('payments_id_seq'), 21, true

This gives an error:

ERROR: function setval(unknown) does not exist

Using ALTER SEQUENCE doesn’t seem to work either?

ALTER SEQUENCE payments_id_seq LASTVALUE 22

How can this be done?

Ref: https://www.postgresql.org/docs/current/static/functions-sequence.html

6 Answers
6

Leave a Reply

Your email address will not be published. Required fields are marked *