Lock mode in ExecMergeMatched()

From: Alexander Korotkov <aekorotkov(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Lock mode in ExecMergeMatched()
Date: 2023-03-10 21:42:35
Message-ID: CAPpHfdtW9+Brf8R2QD5dMrkxdbG-5R_GHx4YS_VVKMhQWGSifQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi!

I wonder why does ExecMergeMatched() determine the lock mode using
ExecUpdateLockMode(). Why don't we use lock mode set by
table_tuple_update() like ExecUpdate() does? I skim through the
MERGE-related threads, but didn't find an answer.

I also noticed that we use ExecUpdateLockMode() even for CMD_DELETE.
That ends up by usage of LockTupleNoKeyExclusive for CMD_DELETE, which
seems plain wrong for me.

The proposed change is attached.

------
Regards,
Alexander Korotkov

Attachment Content-Type Size
0001-ExecMergeMatched-lock-mode.patch application/octet-stream 664 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Nathan Bossart 2023-03-10 22:02:56 Re: recovery modules
Previous Message Regina Obe 2023-03-10 21:05:46 RE: Ability to reference other extensions by schema in extension scripts