I am currently working on a research project at University of Ottawa.
As part of the project, we need to implement a new feature for the
trigger creation in
PostgreSQL, which defines aliases for the "old" and "new" data by
adding
the REFERENCING clause to the CREATE TRIGGER statement. Based on my
research, the following items need to be modified to support the
REFERENCING option.
- modify backend\parser\gram.y and keyword.c
- modify CreateTrigStmt node struct
- modify pg_trigger struct in pg_trigger.h, Trigger and TriggerDesc
structs in rel.h, TriggerData struct in trigger.h
- modify CreateTrigger(), RelationBuildTriggers(), InsertTrigger(),
CopyTriggerDesc(), FreeTriggerDesc(), ExecBSInsertTriggers(),
ExecASInsertTriggers(), ExecBRInsertTriggers(),
ExecARInsertTriggers(), ExecBSDeleteTriggers(),
ExecASDeleteTriggers(), ExecBRDeleteTriggers(),
ExecARDeleteTriggers(), ExecBSUpdateTriggers(),
ExecASUpdateTriggers(), ExecBRUpdateTriggers(), ExecBRUpdateTriggers()
- to handle the new option, create new fuctions
ExecBSOInsertTriggers(), ExecASOInsertTriggers(),
ExecBROInsertTriggers(), ExecAROInsertTriggers(),
ExecBSNInsertTriggers(), ExecASNInsertTriggers(),
ExecBRNInsertTriggers(), ExecARNInsertTriggers(),
ExecBSODeleteTriggers(), ExecASODeleteTriggers(),
ExecBRODeleteTriggers(), ExecARODeleteTriggers(),
ExecBSNDeleteTriggers(), ExecASNDeleteTriggers(),
ExecBRNDeleteTriggers(), ExecARNDeleteTriggers(),
ExecBSOUpdateTriggers(), ExecASOUpdateTriggers(),
ExecBROUpdateTriggers(), ExecBROUpdateTriggers(),
ExecBSNUpdateTriggers(), ExecASNUpdateTriggers(),
ExecBRNUpdateTriggers(), ExecBRNUpdateTriggers()
- add supports to ExecutePlan(), ExecInsert(), ExecDelete(),
ExecUpdate() in \backend\executor\execMain.c
- add supports to backend\node\equalfuncs.c and copyfuncs.c
Do I miss anything? Could anyone give me your advices on the
implementation?
Thanks.
Henry