Query goal: | Find the number of user defined triggers by action orientation (ROW, STATEMENT), action timing (BEFORE, AFTER, INSTEAD OF), and event type (INSERT, UPDATE, DELETE) and their combinations. |
Query type: | Sofware measure (Numeric values (software measures) about the database) |
Query license: | MIT License |
Data source: | INFORMATION_SCHEMA only |
SQL query: | Click on query to copy it
SELECT action_orientation, action_timing, event_manipulation, Count(DISTINCT trigger_schema ||'.'||event_object_table ||'.'|| trigger_name) AS nr_of_different_triggers FROM information_schema.triggers AS Tr INNER JOIN information_schema.schemata S ON Tr.trigger_schema=S.schema_name WHERE (Tr.trigger_schema = 'public' OR S.schema_owner<>'postgres') GROUP BY ROLLUP (action_orientation, action_timing, event_manipulation) ORDER BY action_orientation, action_timing, event_manipulation, nr_of_different_triggers DESC; |
Collection name | Collection description |
---|---|
Find problems by overview | Queries 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 . |
Find quick numeric overview of the database | Queries that return numeric values showing mostly the number of different types of database objects in the database |
Category name | Category description |
---|---|
Triggers and rules | Queries of this category provide information about triggers and rules in a database. |