Opened 7 years ago

Last modified 7 years ago

#28682 closed New feature

QuerySet.update() : return the IDs of the matched rows — at Initial Version

Reported by: Дилян Палаузов Owned by: nobody
Component: Database layer (models, ORM) Version: 1.11
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

By coincidence all backends that can_return_ids_from_bulk_insert, which happens to be only Postgresql, can also return ids from UPDATE:

UPDATE ... SET ... RETURNING id;

  • update QuerySet.update() to return the PKs of the updated rows
  • update the documentation of QuerySet.update(), stating the specific return type for PG
  • possibly rename can_return_ids_from_bulk_insert to can_return_ids or can_return_anything(_from_select_insert_update_delete)?

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top