Triggers are types of stored procedures that run automatically whenever an event occurs, something like webhooks. And, a few ways to list them.
Prerequisites
- PostgreSQL
List triggers using SQL query
SELECT * FROM pg_trigger;
List triggers using PSQL
Connect to a database first and then run:
\df
List triggers for a specific table using PSQL
\dS <table_name>
Note(s): If there are any, they’ll be shown below the table under Indexes, Foreign-key constraints, etc.
Conclusion
Other potentially useful PostgreSQL listing queries:
On a side note, follow our official channel on Telegram.