I understand how table locks interact with other table locks and how row locks interact with other row locks, but I don't fully understand how table locks interact with row locks.
For instance process A updates some row in table T and therefore acquires a ROW EXCLUSIVE lock. Simultaneously, lets say process B acquires a FOR NO KEY UPDATE row lock on another row. Would process A block process B?
Generally speaking, how to table locks interact with row locks?
Table locks don't interact with row locks at all.
Table locks are taken before the operation starts to prevent conflicting activity on a table-wide level (for example, dropping a table which somebody else is using).
Row locks are taken as the rows are processed. They prevent for example concurrent updates on the same row, while it is perfectly fine for concurrent transactions to update different rows in the same table at the same time.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With