There is a command to reset the sequence to the specified number.

alter sequence id_sec restart with 100; 

How to use myBatis-variable #{value} ?

I tried constructions like:

 alter sequence id_sec restart with quote_literal(#{value}); 

- to no avail. PostgreSQL does not want to parse any of my variable options and only works if you substitute a number directly.

    1 answer 1

    Solution found, instead of restart sequence can be used

     select setval('id_sec', #{value});