Re: MERGE Specification

Boxuan Zhai <bxzhai2010@gmail.com>

From: Boxuan Zhai <bxzhai2010@gmail.com>
To: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: pgsql-hackers@postgresql.org
Date: 2010-08-07T07:58:13Z
Lists: pgsql-hackers

Attachments

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.

I explain the usage of the new features in my pages
https://wiki.postgresql.org/wiki/MergeTestExamples

Please find the patch file in the attachment.

Thanks

Boxuan