Opened 17 years ago
Closed 17 years ago
#5466 closed (invalid)
ForeignKeys with to_field fail to initialize in PostgreSQL
Reported by: | 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: | no | UI/UX: | no |
Description
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 by , 17 years ago
comment:2 by , 17 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
This may be my fault actually, I think I had a conflicting PYTHONPATH