The Backend Engineering Show with Hussein Nasser cover image

All Postgres Locks Explained | A Deep Dive

The Backend Engineering Show with Hussein Nasser

00:00

PostgreSQL Application Advisorial Lock

The application advisory lock has probably its own topic to be honest. But advisory lock are those locks that are acquired by the application. So let's take a look here. This acquires a row level lock on the row with a specified account number. And the second transaction executes this update, sits account two. Right. Transaction two already hold the lock. Thus transaction one is blocked on transaction two. Postgres will detect this and abort the transaction immediately. It's called a deadlock graph. Very careful, especially when when you're up when two transaction try to update the same rows in certain order.

Transcript
Play full episode

The AI-powered Podcast Player

Save insights by tapping your headphones, chat with episodes, discover the best highlights - and more!
App store bannerPlay store banner
Get the app