Give to rules unique names within a schema. Use table name in the rule name. Follow a naming convention.
Data Source
system catalog only
SQL Query
SELECT rulename, schemaname, Count(*) AS number_of_occurrences, string_agg(tablename, '; ' ORDER BY tablename) AS tables
FROM pg_rules
GROUP BY rulename, schemaname
HAVING Count(*)>1
ORDER BY Count(*) DESC, schemaname, rulename;
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
Comfortability of database evolution
Queries of this category provide information about the means that influence database evolution.
Naming
Queries of this category provide information about the style of naming.
Triggers and rules
Queries of this category provide information about triggers and rules in a database.