Opened 19 years ago
Closed 19 years ago
#3915 closed (duplicate)
manage.py loaddata doesn't update table sequence numbers under Postgres
| Reported by: | Russell Keith-Magee | Owned by: | Russell Keith-Magee |
|---|---|---|---|
| Component: | Core (Serialization) | Version: | dev |
| Severity: | Keywords: | ||
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
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.
Change History (3)
comment:1 by , 19 years ago
| Owner: | changed from to |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
comment:2 by , 19 years ago
Note:
See TracTickets
for help on using tickets.
See also http://code.djangoproject.com/ticket/3790