Semantic Constraint Enforcement - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
Language
English (United States)
Last Update
2024-04-03
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

The enforcement of a constraint depends on how its base table is accessed. If the base table is accessed directly, its column and table constraints are enforced. Date (2001a) calls this "The Golden Rule," which he defines as follows: No update operation must assign to any database a value that causes its database predicate to evaluate to false. This is a generalization of the Closed World Assumption (see The Closed World Assumption and The Closed World Assumption Revisited).

By this definition, the checking time is immediate for any update. That is, the constraint is checked at statement boundaries, not deferred for checking at COMMIT time boundaries. If this is not done, inconsistent or false data can be entered into the database, even if only for a brief time and even if the inconsistency is private to the transaction in question. A query that follows this inconsistent update within the boundaries of an explicit transaction may report erroneous information. Vantage does not support deferred integrity checking.

If a base table is accessed by means of a view, then the enforcement of any WHERE clause constraints specified in the view definition depends on whether the view is also defined WITH CHECK OPTION or not (see Semantic Integrity Constraints for Updatable Views).

Views inherit the constraints of their underlying base tables; therefore, base table constraints cannot be violated by updating through a view. However, additional constraints defined by means of a WHERE clause specification in a view definition can be bypassed if the view is not also defined WITH CHECK OPTION. The result is not a violation of any constraints defined on underlying base tables, but the insertion of a row that cannot be seen from that view.