SELECT domain_schema, domain_name , domain_default, string_agg(table_schema || '.' || table_name || '.' || column_name, '; ' ORDER BY table_schema, table_name) AS columns
FROM information_schema.columns c
RIGHT JOIN information_schema.domains d USING (domain_schema, domain_name)
INNER JOIN information_schema.schemata s
ON d.domain_schema=s.schema_name
WHERE d.domain_default IS NOT NULL
AND (d.domain_schema = 'public'
OR s.schema_owner<>'postgres')
GROUP BY domain_schema, domain_name , domain_default
ORDER BY domain_schema, domain_name;
Collections
This query belongs to the following collections:
Name
Description
Find problems by overview
Queries 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 .
Categories
This query is classified under the following categories:
Name
Description
Default value
Queries of this catergory provide information about the use of default values.
Domains
Queries of this category provide information about reusable specifications of column properties.