The list of all the queries

Rules with the same name within the same schema

Query goal: Find names of rules that are used within the same schema more than once. Give different triggers different names.
Query type: Problem detection (Each row in the result could represent a flaw in the design)
Query reliability: High (Few or no false-positive results)
Query license: MIT License
Fixing suggestion: 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: Click on query to copy it

SELECT rulename, schemaname, Count(*) AS number_of_occurrences, string_agg(tablename, ';<br>' ORDER BY tablename) AS tables
FROM pg_rules
GROUP BY rulename, schemaname
HAVING Count(*)>1
ORDER BY Count(*) DESC, schemaname, rulename;

Collections where the query belongs to

Collection nameCollection description
Find problems automaticallyQueries, 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 where the query belongs to

Category nameCategory description
Comfortability of database evolutionQueries of this category provide information about the means that influence database evolution.
NamingQueries of this category provide information about the style of naming.
Triggers and rulesQueries of this category provide information about triggers and rules in a database.

The list of all the queries