15.00 - Domain Rules for Primary Keys - Teradata Database

Teradata Database Design

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

Domain Rules for Primary Keys

The following rules apply to primary key domains and referential integrity. The domain rules for primary keys apply equally, the necessary changes being made, to all candidate keys:

  • New primary key values must be drawn from the domain set of all valid values for the column on which the primary key value is defined.
  • You cannot define a primary key using any column defined with an XML, BLOB, or CLOB data type.
  • You cannot delete a primary key that references foreign keys because that violates the referential integrity rule.
  • The rules for deleting a primary key that has foreign key references are as follows:

     

        Rule Name

                                                       Rule Description

    Prevent

  • Do not delete a PK if it references an existing FK.
  • Do not change the value of PK if it references an existing FK.
  • Reassign

  • Change the value of FK to a different PK value before deleting the old PK row.
  • Change the value of FK to a different PK value before changing the old PK value.
  • Nullify

  • Change the FK value to NULL before deleting the old PK row.
  • Change the FK value to NULL before changing the old PK value.
  • Cascade

  • Delete the FK row before deleting the old PK row.
  • Delete the FK row before changing the old PK value.
  • Each of these rules preserves the referential integrity of a PK-FK relationship.