Opened 6 years ago

Closed 6 years ago

#13952 closed (invalid)

r13363 brokes add model in admin for models with inheritance

Reported by: krejcik Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords: postgres sequence
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Appears for multi-table inheritance during save of new instance from admin.
Raised exception is:
IntegrityError at /admin/.../add/
null value in column "basefoo_ptr_id" violates not-null constraint

Change History (3)

comment:1 Changed 6 years ago by krejcik

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

in r13962 works everything properly

comment:2 Changed 6 years ago by krejcik

sorry, it should be in r13362 works everything properly

comment:3 Changed 6 years ago by ales_zoulek

  • Component changed from django.contrib.admin to Database layer (models, ORM)
  • Keywords postgres sequence added
  • milestone 1.3 deleted
  • Resolution set to invalid
  • Status changed from new to closed

Marking as invalid.

The problem wasn't in django it self. The r13362 introduced pg_get_serial_sequence().

When altering a column and asigning the sequence to it, you need to call "ALTER SEQUENCE name OWNED BY table.column;" in order to make pg_get_serial_sequence() work properly.

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