for example i have a student table with (studentid) i want to get a list of triggers that use this field...
for example if in table X there is a trigger that uses studentid i want it to be shown in the query result.
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
If you want to filter on the tablle name if you have too many triggers just add a filter on relname from pg_class
SELECT tgrelid::regclass,t.tgname FROM pg_trigger t, pg_proc p, pg_class c WHERE c.oid = t.tgrelid AND t.tgfoid=p.oid AND c.relkind = 'r' AND p.prosrc LIKE '%studentid%' AND c.relname = 'X';