Does PostgreSQL and other databases have a feature to reset serial/identity values?
In Postgres you can use ALTER SEQUENCE RESTART ...  or setval() function to change that "internal counter" without truncating the table.

See also http://www.sqlines.com/postgresql/datatypes/serial for examples.

In SQL Server you can use DBCC CHECKIDENT to see and reset identity value of the table.