| Goal | Triggers can be used to maintain data integrity in a database by causing rejection of data that does not conform to certain rules. Therefore, the number of triggers in a database gives some indications about the state of enforcing constraints at the database level. The query does not count internal triggers. |
|---|---|
| Notes | The query counts "ordinary" triggers as well as event triggers. It counts these over all the different schemas that contain user-defined schema objects. It discards triggers that the system creates automatically to enforce referential integrity. If one trigger is associated with multiple events (for instance, INSERT and UPDATE), then it counts it as one trigger. |
| Type | Sofware measure (Numeric values (software measures) about the database) |
| License | MIT (opens in new tab) |
| Data Source | INFORMATION_SCHEMA+system catalog |
| SQL Query |
|
Categories
This query is classified under the following categories:
Triggers and rules
Queries of this category provide information about triggers and rules in a database.
| Name | Description |
|---|---|
| Triggers and rules | Queries of this category provide information about triggers and rules in a database. |