Opened 11 years ago

Closed 11 years ago

#5466 closed (invalid)

ForeignKeys with to_field fail to initialize in PostgreSQL

Reported by: David Cramer <dcramer@…> Owned by: nobody
Component: Database layer (models, ORM) Version: other branch
Severity: Keywords: qs-rf
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


The issue seems to arrise when you set a to_field on a ForeignKey. Postgre fails to create the constraint.

This happens in tests/regressiontests/query/ on the Report model

psycopg.ProgrammingError: ERROR: there is no unique constraint matching given k
eys for referenced table "queries_author"

ALTER TABLE "queries_report" ADD CONSTRAINT creator_id_refs_num_33619fc8 FOREIGN
KEY ("creator_id") REF

Change History (2)

comment:1 Changed 11 years ago by David Cramer <dcramer@…>

This may be my fault actually, I think I had a conflicting PYTHONPATH

comment:2 Changed 11 years ago by anonymous

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.
Back to Top