All Postgres Locks Explained | A Deep Dive @hnasr
All Postgres Locks Explained | A Deep Dive  @hnasr
Uploaded March 2023 | Updated November 2026, 23 hours ago
Fundamentals of Database Engineering udemy course (link redirects to udemy with coupon)
database.husseinnasser.com

In this video I do a deep dive in all locks obtained by postgres, I learned a lot while making this video and hope you enjoy it.

0:00 Intro
2:30 What are Locks?
5:30 Overview of Postgres Locks
9:10 Table-Level Locks
11:40 ACCESS EXCLUSIVE
17:40 ACCESS SHARE
19:00 ROW SHARE20:15 ROW EXCLUSIVE
21:15 SHARE UPDATE EXCLUSIVE
23:30 SHARE
24:50 SHARE ROW EXCLUSIVE
25:18 EXCLUSIVE
25:30 Table Lock Conflict Matrix
28:30 Row-Level Locks
30:00 FOR UPDATE
33:00 FOR NO KEY UPDATE
34:00 FOR SHARE
34:40 FOR KEY SHARE
35:10 Row Lock Conflict Matrix
39:25 Page-Level Locks
42:00 Deadlocks
46:00 Advisory Locks
47:20 Summary


Doc postgresql.org/docs/current/explicit-locking.html



Fundamentals of Backend Engineering Design patterns udemy course (link redirects to udemy with coupon)
backend.husseinnasser.com

Fundamentals of Networking for Effective Backends udemy course (link redirects to udemy with coupon)
network.husseinnasser.com

Follow me on Medium
medium.com/@hnasr/membership


Introduction to NGINX (link redirects to udemy with coupon)
nginx.husseinnasser.com

Python on the Backend (link redirects to udemy with coupon)
python.husseinnasser.com

Become a Member on YouTube
youtube.com/channel/UC_ML5xP23TOWKUcc-oAE_Eg/join

Buy me a coffee if you liked this
buymeacoffee.com/hnasr

Arabic Software Engineering Channel
youtube.com/channel/UChWZsjdoRvZ0T9QWZOD6UpA

🔥 Members Only Content
youtube.com/playlist?list=UUMO_ML5xP23TOWKUcc-oAE_Eg



🏭 Backend Engineering Videos in Order
backend.husseinnasser.com

💾 Database Engineering Videos
youtube.com/playlist?list=PLQnljOFTspQXjD0HOzN7P2tgzu7scWpl2

🎙️Listen to the Backend Engineering Podcast
husseinnasser.com/podcast

Gears and tools used on the Channel (affiliates)

🖼️ Slides and Thumbnail Design
Canva
partner.canva.com/c/2766475/647168/10068


Stay Awesome,
Hussein
All Postgres Locks Explained | A Deep DiveNew course alert - Unlocking Backend PerformanceWhat threads get from their processGitHub SSH key is Leaked - How bad is this?Does discipline work?Cloudflare Open sources Pingora (NGINX replacement)The only abstraction Im ok with, probablyOffloading CPU Intensive to threadsTLS done in the NIC?They Enabled Postgres Partitioning and their Backend fell apartUpgrading to MySQL 8? Watch out for thisWhat are page tables?
Hussein Nasser |

All Postgres Locks Explained | A Deep Dive

SHARE TO X SHARE TO REDDIT SHARE TO FACEBOOK WALLPAPER