Django creates the test database for Postgresql with incorrect sequences start values Django creates the test database for Postgresql with incorrect sequences start values postgresql postgresql

Django creates the test database for Postgresql with incorrect sequences start values


If you don't recreate the db with every test, then you've have to reset the sequences yourself.

Also, I think that the sequence definition you've posted were found when inspecting the db after the tests run with a db tool. In that case, I think your db tool is presenting you the SQL to create the sequence as it is: after it's been used.

The fact that it doesn't happen on sqlite has to do with it using a in-memory db by default. Therefore, it's being re-created in every test run.