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?
The problem with the view information_schema.triggers (besides being slow) is, per documentation:
The view triggers contains all triggers defined in the current database on tables and views that the current user owns or has some privilege other than
SELECT
on.
Meaning, you only get to see triggers you have appropriate privileges on.
To see all triggers for a table, look in the system catalog pg_trigger
SELECT tgname
FROM pg_trigger
WHERE tgrelid = 'myschema.mytbl'::regclass; -- optionally schema-qualified
Works for tables and views.
Or you could use a GUI like pgAdmin that displays the list under the table node in the object browser.