PostgreSQL Lock Conflicts

Database engineering course | @hnasr |

ShareRowExclusiveLock

The ShareRowExclusiveLock lock is a Table lock. This list shows the commands that acquire ShareRowExclusiveLock and what locks conflicts with it.

The following commands acquire ShareRowExclusiveLock Table lock

  1. CREATE TRIGGER
  2. ALTER TABLE ENABLE/DISABLE TRIGGER
  3. ALTER TABLE ADD FOREIGN KEY NOT VALID (PARENT)
  4. ALTER TABLE ADD FOREIGN KEY NOT VALID (CHILD)
  5. ALTER TABLE ADD FOREIGN KEY (CHILD)

The following are table locks conflicting with ShareRowExclusiveLock

  1. RowExclusiveLock
  2. ShareUpdateExclusiveLock
  3. ShareLock
  4. ShareRowExclusiveLock
  5. ExclusiveLock
  6. AccessExclusiveLock