Domain

A user-defined data type based on an existing data type

A domain (sometimes referred to as a "derived type") is a user-defined data type based on an existing data type, typically to provide what is effectively a common definiion of a check constraint, which can be used in multiple table definitions.

Caveats

Unlike a regular constraint, while any constraints applied to the domain will be checked when converting a column to the domain type, or inserting the column, they will not be checked retroactively if the domain definition is modified.

Change history

Examples

 

Categories

See also

CREATE DOMAIN, ALTER DOMAIN, DROP DOMAIN