Patent ID: 7440956

Claim:
A method comprising: receiving a constraint command, wherein the constraint command specifies a parent table, a primary key in the parent table, a child table, and a foreign key in the child table, wherein the constraint command requests that all values for the primary key in the parent table be present in the foreign key in the child table; and enforcing that all values for the primary key in the parent table are present in the foreign key in the child table, wherein the enforcing further comprises: receiving a first insert command, wherein the first insert command specifies a target key, a target value for the target key, and a target table, determining whether the target table matches the parent table and whether, within a transaction that comprises the first insert command, the child table comprises at least one row with a foreign key value that equals the target value of the primary key, inserting the target value into the target table if the target table matches the parent table and, within the transaction that comprises the first insert command, the child table comprises at least one row with the foreign key value that equals the target value of the primary key, returning an error to an application that sent the first insert command if the target table does not match the parent table, and returning the error to the application that sent the first insert command if, within the transaction that comprises the first insert command, the child table does not comprise the at least one row with the foreign key value that equals the target value of the primary key.