﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
18485	Document behavior of PostgreSQL/Oracle when manually setting autoincrementing fields	greg.nicholas@…	François Freitag	"As described in #11423, certain DB backends will not automatically set the sequence number for AutoField-based primary keys if the PKs are explicitly set.

As the ticket discussion states, this is a known feature of PostgreSQL and Oracle, and the 'sqlsequencereset' management command exists to get the sequence in sync. MySQL and SQLite handle the resetting automatically.

Although this difference is inherent at the database level, nothing in Django's database documentation makes this apparent. I would argue that typical Django users would be completely unaware of this issue (as was I, coming from a MySQL background). To me, it looked like a bug in the ORM or in psycopg2.

I suggest that the https://docs.djangoproject.com/en/dev/ref/databases/ page include a warning about this difference, and a reference to the 'sqlsequencereset' command."	Cleanup/optimization	closed	Documentation	dev	Normal	fixed	postgresql oracle autofield		Accepted	1	0	0	0	0	0
