# save() behavior when updating model with default primary keys

**URL:** <https://forum.djangoproject.com/t/save-behavior-when-updating-model-with-default-primary-keys/30778>\
**Category:** Using the ORM\
**Created:** [May 3, 2024, 1:34am UTC](https://forum.djangoproject.com/t/save-behavior-when-updating-model-with-default-primary-keys/30778 "2024-05-03T01:34:59Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![KenWhitesell](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.djangoproject.com/kenwhitesell/32/280_2.png) [@KenWhitesell](https://forum.djangoproject.com/u/KenWhitesell)\
**Post date:** [May 3, 2024, 2:32am UTC](https://forum.djangoproject.com/t/save-behavior-when-updating-model-with-default-primary-keys/30778/4 "2024-05-03T02:32:36Z")

</div>

I found the section in the docs at [Model instance reference | Django documentation | Django](https://docs.djangoproject.com/en/5.0/ref/models/instances/#how-django-knows-to-update-vs-insert) that I think covers this.

> The one gotcha here is that you should be careful not to specify a primary-key value explicitly when saving new objects, if you cannot guarantee the primary-key value is unused. For more on this nuance, see [Explicitly specifying auto-primary-key values](https://docs.djangoproject.com/en/5.0/ref/models/instances/#explicitly-specifying-auto-primary-key-values) above and [Forcing an INSERT or UPDATE](https://docs.djangoproject.com/en/5.0/ref/models/instances/#forcing-an-insert-or-update) below.

So apparently this is expected behavior, and as such, I’m moving this thread back to the “Using Django” bucket.

---

_[View the full topic](https://forum.djangoproject.com/t/save-behavior-when-updating-model-with-default-primary-keys/30778)._
