Goal Identify the number of domains in different schemas.
Notes The query only returns data about schemas that have at least one domain.
Type Sofware measure (Numeric values (software measures) about the database)
License MIT License
Data Source INFORMATION_SCHEMA only
SQL Query
SELECT domain_schema, Count(*) AS number_of_domains
FROM information_schema.domains
WHERE 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)
GROUP BY ROLLUP(domain_schema)
ORDER BY domain_schema;

Collections

This query belongs to the following collections:

NameDescription
Find problems about base tablesA selection of queries that return information about the data types, field sizes, default values as well as general structure of base tables. Contains all the types of queries - problem detection, software measure, and general overview
Find problems by overviewQueries that results point to different aspects of database that might have problems. A human reviewer has to decide based on the results as to whether there are problems or not .
Find quick numeric overview of the databaseQueries that return numeric values showing mostly the number of different types of database objects in the database
Categories

This query is classified under the following categories:

NameDescription
DomainsQueries of this category provide information about reusable specifications of column properties.