Query goal: | 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. |
Query type: | Problem detection (Each row in the result could represent a flaw in the design) |
Query reliability: | Unspecified (The query is not used for detecting flaws or the reliability is unknown) |
Query license: | MIT License |
Data source: | INFORMATION_SCHEMA only |
SQL query: | Click on query to copy it
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; |
Collection name | Collection 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 . |
Category name | Category 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. |
Reference |
---|
https://digikogu.taltech.ee/et/item/05157bb4-763e-4a9d-bc50-2025692b8e1d |
https://pgxn.org/dist/constr_name_unif |
https://github.com/katrinaibast/constr_name_unif |