I have one requirement that I have to get the list of triggers associated to the given table/view.
Can anyone help me to find the triggers for a table in PostgreSQL?
This will return all the details you want to know
select * from information_schema.triggers
or if you want to sort the results of a specific table then you can try
SELECT event_object_table
,trigger_name
,event_manipulation
,action_statement
,action_timing
FROM information_schema.triggers
WHERE event_object_table = 'tableName' -- Your table name comes here
ORDER BY event_object_table
,event_manipulation
the following will return table name that has trigger
select relname as table_with_trigger
from pg_class
where pg_class.oid in (
select tgrelid
from pg_trigger
)