Using Constraints with Temporal Tables | Temporal Table Support | Vantage - 17.05 - Using Constraints with Temporal Tables - Teradata Database

Teradata Vantage™ - Temporal Table Support

prodname
Advanced SQL Engine
Teradata Database
vrm_release
17.00
17.05
created_date
June 2020
category
Programming Reference
featnum
B035-1182-170K

Column or table level constraints defined on temporal tables can be associated with a time dimension, and are of three basic types:

Temporal Constraint Form Description
CURRENT VALIDTIME The constraint is applied to all current and future rows. History rows are not checked for constraint violations.
SEQUENCED VALIDTIME The constraint is applied to all future, current, and open history rows and ensures that the constraint is not violated at any instant of time in the valid-time dimension.
NONSEQUENCED VALIDTIME The constraint is applicable to all open rows in the table, and treats the valid-time column as a regular, nontemporal column. A nonsequenced constraint on a valid-time table is similar in semantics to a constraint defined on a nontemporal table.

For tables with transaction-time columns, nonreferential constraints are always considered to be current in the transaction-time dimension. These constraints are enforced only on rows that are open in transaction time. For bitemporal tables, constraints are enforced only on open rows that satisfy the valid-time constraint temporal qualifier.

Because constraints are not allowed on columns with a period data type, constraints are not allowed on valid-time or transaction-time columns.

To ensure application portability to ANSI standards for temporal SQL, Teradata recommends explicit specification of all temporal qualifiers.