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?
select tgname
,relname
,tgenabled
,nspname from pg_trigger
join pg_class on (pg_class.oid=pg_trigger.tgrelid)
join pg_namespace on (nspowner=relowner);
tgenabled (To check if its disabled)
O = trigger fires in "origin" and "local" modes,
D = trigger is disabled,
R = trigger fires in "replica" mode,
A = trigger fires always.