The list of all the queries

UPDATE triggers

Query goal: Find all UPDATE triggers. Make sure that they specify a correct set of columns in which data modification will fire the trigger.
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 trigger_schema, trigger_table, trigger_name,  event_manipulation, action_orientation, action_timing, action_condition, columns
FROM
(SELECT 
T. trigger_schema, 
T.event_object_table AS trigger_table,
T.trigger_name,
T.action_condition,
T.event_manipulation,
T.action_orientation,
T.action_timing,
array_agg(event_object_column::text) AS columns
FROM 
  (SELECT * FROM information_schema.triggers WHERE event_manipulation='UPDATE') AS T LEFT JOIN  information_schema.triggered_update_columns AS TUC
ON T.trigger_schema=TUC.trigger_schema AND T.trigger_name=TUC.trigger_name AND
 T.event_object_table=TUC.event_object_table
GROUP BY T. trigger_schema,  T.event_object_table, T.trigger_name, T.event_manipulation,
T.action_orientation,
T.action_timing, T.action_condition) AS f
ORDER BY trigger_schema, trigger_table, trigger_name;

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

The list of all the queries