set next value of sequence postgres code example Example: postgresql update sequence next value ALTER SEQUENCE seq_name RESTART WITH 22;