Home > Blockchain >  Lock level on MERGE statement
Lock level on MERGE statement

Time:05-31

Does anyone know what is the lock level (row, table) on PostgreSQL MERGE command? I tried to dig deep on the documentation but I couldn't find anything that could clarify my mind. If anyone have a clue and would be kind to share, that would be very appreciated.

CodePudding user response:

From the manual:

ROW EXCLUSIVE Conflicts with the SHARE, SHARE ROW EXCLUSIVE, EXCLUSIVE, and ACCESS EXCLUSIVE lock modes.

The commands UPDATE, DELETE, INSERT, and MERGE acquire this lock mode on the target table (in addition to ACCESS SHARE locks on any other referenced tables). In general, this lock mode will be acquired by any command that modifies data in a table.

  • Related