Re: MERGE ... WHEN NOT MATCHED BY SOURCE - Mailing list pgsql-hackers

From Ted Yu
Subject Re: MERGE ... WHEN NOT MATCHED BY SOURCE
Date
Msg-id CALte62z9j3Sa-QksqsZ2zQwwxijWgx2Nu3j_+81GE11pcu6MwA@mail.gmail.com
Whole thread Raw
In response to Re: MERGE ... WHEN NOT MATCHED BY SOURCE  (Dean Rasheed <dean.a.rasheed@gmail.com>)
Responses Re: MERGE ... WHEN NOT MATCHED BY SOURCE
List pgsql-hackers


On Sat, Jan 21, 2023 at 3:05 AM Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
On Tue, 10 Jan 2023 at 14:43, Dean Rasheed <dean.a.rasheed@gmail.com> wrote:
>
> Rebased version attached.
>

Rebased version, following 8eba3e3f02 and 5d29d525ff.

Regards,
Dean
Hi,
In transform_MERGE_to_join :

+                       if (action->matchKind == MERGE_WHEN_NOT_MATCHED_BY_SOURCE)
+                               tgt_only_tuples = true;
+                       if (action->matchKind == MERGE_WHEN_NOT_MATCHED_BY_TARGET)

There should be an `else` in front of the second `if`.
When tgt_only_tuples and src_only_tuples are both true, we can come out of the loop.

Cheers

pgsql-hackers by date:

Previous
From: "Karl O. Pinc"
Date:
Subject: Re: Doc: Rework contrib appendix -- informative titles, tweaked sentences
Next
From: Andrew Dunstan
Date:
Subject: Re: run pgindent on a regular basis / scripted manner