| Goal | Find simple check constraints (involve one column) that are associated with a base table column instead of the domain of the column. Common checks of data in columns that share the same domain should be described at the level of domain not at the level of columns. |
|---|---|
| Notes | In case of the string_agg function, the line break (br) tag is used as a part of the separator for the better readability in case the query result is displayed in a web browser. |
| Type | Problem detection (Each row in the result could represent a flaw in the design) |
| Reliability | Medium (Medium number of false-positive results) |
| License | MIT (opens in new tab) |
| Fixing Suggestion | Make sure that the check that is directly associated with a column applies to all the columns that have the same domain as the column in question. If it is the case, then drop the check constraint that is associated directly with a column and associate it with the domain of the column. |
| Data Source | INFORMATION_SCHEMA+system catalog |
| SQL Query |
|
Categories
This query is classified under the following categories:
CHECK constraints
Queries of this category provide information about CHECK constraints.
Comfortability of database evolution
Queries of this category provide information about the means that influence database evolution.
Domains
Queries of this category provide information about reusable specifications of column properties.
| Name | Description |
|---|---|
| CHECK constraints | Queries of this category provide information about CHECK constraints. |
| Comfortability of database evolution | Queries of this category provide information about the means that influence database evolution. |
| Domains | Queries of this category provide information about reusable specifications of column properties. |