Re: MERGE Specification

From: Boxuan Zhai <bxzhai2010(at)gmail(dot)com>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: MERGE Specification
Date: 2010-08-07 07:58:13
Message-ID: AANLkTinhTGJEs1nAfSPxkQ659YC5Y0JW8hAgo=AiKjVD@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

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

Attachment Content-Type Size
merge_do_nothing.patch text/plain 68.0 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2010-08-07 09:42:58 Re: remove upsert example from docs
Previous Message Heikki Linnakangas 2010-08-07 07:37:58 Re: Surprising dead_tuple_count from pgstattuple