Dear All,
I have just finished a new patch, with the following feature:
1. The rule rewriter is changed to a better logic, which is the actions replaced by INSTEAD rules will still catch tuples, but do nothing for them.
2. Triggers can work on MERGE. We don't have CREATE TRIGGER ON MERGE... command. But the triggers (for each statement and for each row) of UPDATE, DELETE and INSERT will be activated by the actions in MERGE.
3. We have DO NOTHING and RAISE ERROR actions now. They can used in both MATCHED and NOT MATCHED situation, and can have additional quals. Currently RAISE ERROR just elog a NOTICE message, since we are stil not sure what should be done for these errors. I just build up the framework for it, preparing for the further extension.
4. The default action of MERGE is RAISE ERROR.
Please find the patch file in the attachment.
Thanks
Boxuan