Opened 9 years ago

Closed 9 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: no UI/UX: no


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 9 years ago by krejcik

in r13962 works everything properly

comment:2 Changed 9 years ago by krejcik

sorry, it should be in r13362 works everything properly

comment:3 Changed 9 years ago by Ales Zoulek

Component: django.contrib.adminDatabase layer (models, ORM)
Keywords: postgres sequence added
milestone: 1.3
Resolution: invalid
Status: newclosed

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