15.00 - Rules for FOREIGN KEY … REFERENCES Referential Constraints Only - Teradata Database

Teradata Database Design

prodname
Teradata Database
vrm_release
15.00
category
User Guide
featnum
B035-1094-015K

Rules for FOREIGN KEY … REFERENCES Referential Constraints Only

Other than their not actually enforcing referential integrity, most of the rules for Referential Constraints are identical to those documented by “Rules for Both Column‑Level and Table‑Level Foreign Key Constraints” on page 649 and by “Rules for Table‑Level FOREIGN KEY … REFERENCES Constraints Only” on page 652.

The exceptions are documented by the following set of rules that apply specifically to the specification and use of Referential Constraints.

  • You can specify standard RI, batch RI, and Referential Constraints in the same table, but not for the same column set.
  • You can specify Referential Constraints for both of the following constraint types:
  • FOREIGN KEY (FK_column_set) REFERENCES (parent_table_PK_column_set)
  • (NFK_column_set) REFERENCES (parent_table_AK_column_set)
  • where NFK indicates non-foreign key and parent_table_AK_column_set indicates an alternate key in the parent table.

  • Referential Constraint references count toward the maximum of 64 references permitted for a table referenced as a parent even though they are not enforced by the system.
  • INSERT, DELETE, and UPDATE requests are not permitted against tables with unresolved, inconsistent, or non-valid Referential Constraints. This rule is identical to the rule enforced for standard and batch RI.
  • The candidate key acting as the primary key in the referenced table in the constraint need not be explicitly declared to be unique using the PRIMARY KEY or UNIQUE keywords or by declaring it to be a USI in the table definition.