Opened 2 years ago

Closed 2 years ago

Last modified 2 years ago

#34177 closed Bug (fixed)

QuerySet.bulk_create() crashes on "pk" in unique_fields.

Reported by: Mariusz Felisiak Owned by: Mariusz Felisiak
Component: Database layer (models, ORM) Version: 4.1
Severity: Release blocker Keywords:
Cc: Chih Sean Hsu, Carlton Gibson Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Mariusz Felisiak)

QuerySet.bulk_create() crashes on "pk" in unique_fields which should be allowed.

  File "/django/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.ProgrammingError: column "pk" does not exist
LINE 1: ...S (3127, 3, 3, 'c'), (3128, 4, 4, 'd') ON CONFLICT("pk") DO ...

Bug in 0f6946495a8ec955b471ca1baaf408ceb53d4796.

Change History (5)

comment:1 by Mariusz Felisiak, 2 years ago

Has patch: set

comment:2 by Mariusz Felisiak, 2 years ago

Description: modified (diff)

comment:3 by Carlton Gibson, 2 years ago

Triage Stage: UnreviewedReady for checkin

comment:4 by GitHub <noreply@…>, 2 years ago

Resolution: fixed
Status: assignedclosed

In 7d53298:

Fixed #34177 -- Fixed QuerySet.bulk_create() crash on "pk" in unique_fields.

Bug in 0f6946495a8ec955b471ca1baaf408ceb53d4796.

comment:5 by Mariusz Felisiak <felisiak.mariusz@…>, 2 years ago

In 3b0a8ea:

[4.1.x] Fixed #34177 -- Fixed QuerySet.bulk_create() crash on "pk" in unique_fields.

Bug in 0f6946495a8ec955b471ca1baaf408ceb53d4796.
Backport of 7d5329852f19c6ae78c6f6f3d3e41835377bf295 from main

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