The list of all the queries

The same trigger function is used in case of multiple tables

Query goal: Find trigger functions that are used in case of more than one table. Although it is legal, one must be careful when changing the functions in order to avoid unwanted consequences.
Query type: General (Overview of some aspect of the database.)
Query license: MIT License
Data source: INFORMATION_SCHEMA only
SQL query: Click on query to copy it

SELECT action_statement, string_agg(DISTINCT event_object_schema || '.' || event_object_table, ';<br>' ORDER BY event_object_schema || '.' || event_object_table) AS tables, Count(DISTINCT event_object_schema || '.' || event_object_table) AS nr_of_different_tables, Count(*) AS nr_of_different_triggers
FROM INFORMATION_SCHEMA.triggers
GROUP BY action_statement
HAVING Count(DISTINCT event_object_schema || '.' || event_object_table)>1
ORDER BY Count(DISTINCT event_object_schema || '.' || event_object_table) DESC;

Collections where the query belongs to

Collection nameCollection description
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 .

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.
Triggers and rulesQueries of this category provide information about triggers and rules in a database.

The list of all the queries