Re: merge command - GSoC progress

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Boxuan Zhai <bxzhai2010(at)gmail(dot)com>
Cc: Greg Smith <greg(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: merge command - GSoC progress
Date: 2010-08-04 12:09:51
Message-ID: 4C59588F.3030809@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 04/08/10 07:55, Boxuan Zhai wrote:
> 2010/8/4 Greg Smith<greg(at)2ndquadrant(dot)com>
>> Boxuan Zhai wrote:
>>> And, I have tested the running of MERGE command with different situations.
>>> I am sorry that I didn't create regression test files, because I am not sure
>>> how to add new files in the git package.
>>
>> git add<filename> ?

Yep. I believe Boxuan is using git in a simplistic way, doing just "git
diff" to create patches. For adding new files, you need to do "git add
<filename>", but note that this adds the new file to "staging area". To
view all changes in the staging area, use "git diff --cached", but that
won't show any modifications to existing files that you haven't also
"git add"ed. So to generate a patch you need to "git add" all modified
and added files ("git add -u" will add all modified files
automatically), and then use "git diff --cached" to generate the diff.

> In fact, I have created a merge.sql with simple merge example. I put it in
> the folder of /src/test/regress/sql/ and modified the serial_schedule file
> to add a line of : test: merge
> Is this correct?

Yep. You also need to add it to parallel_schedule, "make check" and
"make installcheck-parallel" use parallel_schedule and "make
installcheck" uses serial_schedule.

> But, I don't know how to run regress to test this sql file. My "make check"
> fails when install the db. I think this is because I do it under a MinGW
> environment and some parameters are not matched with the default setting of
> postgres.
> I can configure, make install , initdb and do sql query in psql successfully
> in my machine. So the source code itself should be correct.

Hmm, I don't know much about MinGW, but "make check" should work. But
since you can install and run postgres normally, you can use "make
installcheck" instead. That runs the regression suite against an already
running instance of postgres.

> I put my merge.sql in attachment, in case anyone want to have a look.

Thanks, that helps a lot.

Here's a combined patch which includes the latest code patch from
"tested_merge.tar", with the merge.sql test case, the corresponding
expected output file, and the required changes to the schedule files.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Attachment Content-Type Size
merge-command-2010-08-03.patch text/x-diff 62.7 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Tiikkaja 2010-08-04 12:22:54 Re: Proposal / proof of concept: Triggers on VIEWs
Previous Message Bruce Momjian 2010-08-04 12:06:37 Re: Develop item from TODO list