I have been finally able to get the right set of files. I going with below
approach:
1) Add a new column in pg_trigger called tgiscascaded
2) Change pg_trigger.h for this
3) Made changes in trigger.c to insert this values
4) Corresponding changes made in
- reltrigger.h
- parsenode.h
5) Changed gram.y to understand a new key word in CREATE TRIGGER statement
"CASCADED".
- The new option will be optional and will apply only to
non-constraint triggers
- If the option is specified trigger will CASCADE to child
tables
6) I just complied the source code (modified with above changes) and it
- Added a new column in pg_trigger
- The new column is able to derive its value from CREATE
TRIGGER statement based on whether CASDADED was specified or not
- The value is True if the option was specified
- The value is false if the option was not specified
7) Now I will work on trigger firing mechanism with below approach
- Before firing triggers, check if it's an inherited table
- First get CASCADED triggers for parents and fire them
- Proceed as usual
Any suggestion on improving the approach or comments on need for this
feature are welcome.
Regards
Sameer