Find the names of domain CHECK constraints that have been system-generated. Names should follow the same style. If there is a mix of system-generated and user-defined names, then the style is most probably different.
Type
Problem detection (Each row in the result could represent a flaw in the design)
Reliability
Unspecified (The query is not used for detecting flaws or the reliability is unknown)
SELECT domain_schema, domain_name, constraint_name
FROM INFORMATION_SCHEMA.domain_constraints
WHERE constraint_name ILIKE domain_name || '_check%' AND
domain_schema NOT IN (SELECT schema_name
FROM INFORMATION_SCHEMA.schemata
WHERE schema_name<>'public' AND
schema_owner='postgres' AND schema_name IS NOT NULL)
ORDER BY domain_schema, domain_name;
Collections
This query belongs to the following collections:
Name
Description
Find problems automatically
Queries, that results point to problems in the database. Each query in the collection produces an initial assessment. However, a human reviewer has the final say as to whether there is a problem or not .
Categories
This query is classified under the following categories:
Name
Description
Domains
Queries of this category provide information about reusable specifications of column properties.
Naming
Queries of this category provide information about the style of naming.