-
Bug
-
Resolution: Done
-
Major
-
None
-
None
The metadatavalidator will resolve foreign keys as long as the columns match - but does not reorder the fk columns nor track the referenced order which means that the referenced key can be wrong. For example:
CREATE FOREIGN TABLE G1(g1e1 integer, g1e2 integer, PRIMARY KEY(g1e1, g1e2)); CREATE FOREIGN TABLE G2(g2e1 integer, g2e2 integer, FOREIGN KEY (g2e1, g2e2) REFERENCES G1(g1e2, g1e1));
Note that the elements are reversed in the references list, but this is not captured in the resolved foreign key meaning that it effectively represents a relationship on g2e1,g2e2 with g1e1,g1e2.