Django

Code

Ticket #3915 (closed: duplicate)

Opened 2 years ago

Last modified 2 years ago

manage.py loaddata doesn't update table sequence numbers under Postgres

Reported by: russellm Assigned to: russellm
Milestone: Component: Serialization
Version: SVN Keywords:
Cc: Triage Stage: Accepted
Has patch: 0 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

If you are using Postgres and you dump the contents of a database, then load it again using loaddata, the sequence numbers for the dumped table are reset. For some reason, saving the objects as a result of the loaddata doesn't appear to update the sequence numbers.

This manifests as the following error:

ERROR: duplicate key violates unique constraint "myproj_myapp_pkey"
INSERT INTO "myproj_myapp"

being raised when you add the first new object after loading the database contents.

Attachments

Change History

04/03/07 21:40:27 changed by russellm

  • owner changed from jacob to russellm.
  • needs_better_patch changed.
  • stage changed from Unreviewed to Accepted.
  • needs_tests changed.
  • needs_docs changed.

04/04/07 14:27:43 changed by jon.ballard@gmail.com

04/04/07 19:06:07 changed by russellm

  • status changed from new to closed.
  • resolution set to duplicate.

Duplicate of #3790.


Add/Change #3915 (manage.py loaddata doesn't update table sequence numbers under Postgres)




Change Properties
Action