在类似的问题中,我没有得到令人信服的答案。任何人都可以回答可能导致此类错误的原因吗?我会非常感激。
INSERT INTO roles ("name", "description", "organization_id", "created_at", "updated_at")
VALUES ('role_name',NULL, 69, now(),now());
这里,organization_id是外键引用表:organizations(id)
错误:约束 15362041 不是外键约束
查询pg_constraint:
oid conname connamespace contype
**15362041** RI_ConstraintTrigger_c_745708 2200 t
**15362043** RI_ConstraintTrigger_c_745709 2200 t
查询pg_trigger:
oid tgconstraint tgrelid tgname
15362042 **15362041** 12731707 RI_ConstraintTrigger_c_745708
15362044 **15362043** 12731707 RI_ConstraintTrigger_c_745709