1

I have hundreds of DML triggers across multiple schemas. Most of them modify the DML of more than one table.

Using information_schema.triggers and pg_trigger tables I am able to find the list of triggers and the trigger event tables alone.

Is it possible to get the list of tables that are modified(trigger target tables) by each trigger?

1 Answer 1

1

No, because the trigger action is a function, and functions are stored as plain strings in the prosrc column of the pg_proc system catalog table.

You could perform a case insensitive search for table names in that column, but you are going to come up with false positives (any if dynamic SQL is used, with a couple of false negatives too).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.