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.
Type General (Overview of some aspect of the database.)
License MIT License
Data Source INFORMATION_SCHEMA only
SQL Query
SELECT action_statement, string_agg(DISTINCT event_object_schema || '.' || event_object_table, ';
' 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

This query belongs to the following collections:

NameDescription
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

This query is classified under the following categories:

NameDescription
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.