On Thu, Jun 22, 2017 at 12:10 PM, Thomas Munro <thomas.mu...@enterprisedb.com> wrote: > On Thu, Jun 22, 2017 at 9:00 PM, Kang Yuzhe <tiggree...@gmail.com> wrote: >> I just downloaded the patch from GSoC site. > > I just looked at > https://wiki.postgresql.org/wiki/Add_MERGE_command_GSoC_2010 and saw > that the file https://wiki.postgresql.org/wiki/File:Merge_v201.tar was > uploaded on 24 Aug 2010. So I picked a random commit from that date, > git checkout 005e427a22e3bb7fa01a84a7b476a3d6359a0344, and then I was > able to apply that patch with patch -p1 < merge_v201.patch without any > failures.
Thanks so much Thomas! I have managed to apply without any failures by following your approach. Here is a sample what I did after applying the patch. testdb=# BEGIN; BEGIN testdb=# testdb=# MERGE INTO Stock USING Buy ON Stock.item_id = Buy.item_id testdb-# WHEN MATCHED THEN UPDATE SET balance = balance + Buy.volume testdb-# WHEN NOT MATCHED THEN DO NOTHING; MERGE 1 testdb=# SELECT * FROM Stock; item_id | balance ---------+--------- 20 | 1900 10 | 3200 (2 rows) testdb=# ROLLBACK; ROLLBACK I think and believe that though it may be tedious to do so, it is the style Thomas followed to help me that hackers should do to help newbies so that they can pursue their ambition. I am humbled to say that I didn't know how to search git commits by a specific day like what Thomas did. Regards, Zeray -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers