REFERENTIAL_CONSTRAINTS
Applies to: Databricks SQL Databricks Runtime 10.4 LTS and above Unity Catalog only
Preview
This feature is in Public Preview.
INFORMATION_SCHEMA.REFERENTIAL_CONSTRAINTS describes the referential integrity (RI) relationships between foreign keys and primary keys.
The rows returned are limited to constraints on the tables the user is privileged to interact with.
Definition
The REFERENTIAL_CONSTRAINTS
relation contains the following columns:
Name |
Data type |
Nullable |
Standard |
Description |
---|---|---|---|---|
|
|
No |
Yes |
Catalog containing the foreign key constraint. |
|
|
No |
Yes |
Schema containing the foreign key constraints. |
|
|
No |
Yes |
Name of the check constraint. |
|
|
No |
Yes |
Catalog containing the referenced constraint. |
|
|
No |
Yes |
Schema containing the referenced constraint. |
|
|
No |
Yes |
Name of the referenced constraint. |
|
|
No |
Yes |
Always |
|
|
No |
Yes |
Always |
|
|
No |
Yes |
Always |
Constraints
The following constraints apply to the REFERENTIAL_CONSTRAINTS
relation:
Class |
Name |
Column List |
Description |
---|---|---|---|
Primary key |
|
|
Unique identifier for the constraint. |
Foreign key |
|
|
References TABLE_CONSTRAINTS. |
Foreign key |
|
|
References TABLE_CONSTRAINTS. |