frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Pglocks.org

https://pglocks.org/
80•hnasr•12mo ago

Comments

whilenot-dev•12mo ago
I'm a bit lost here.

Locking is a challenging problem in complex systems. Is this list to be interpreted as a "TODO: get rid of locking conflicts in future releases" or more a "NOTE: be aware there are known conflicts that will not change - find ways to work around them"?

EDIT: Also, is the creation of this list an automated or a manual effort?

tux3•12mo ago
I think this is intended as educational material, not a list of things to fix.

The locks are here by necessity, it is not so easy at all to get rid of them. And even in special cases where it is possible, the complexity you have to introduce is not to be taken lightly...

If even a tenth of these disapppeared, it would be incredible, in a very surprising way.

atombender•12mo ago
The creator looks like a developer and teacher, not a Postgres core team member. So I assume this is for documentation purposes.

I actually like this a lot, as there isn't a single place in the Postgres documentation that lists all the possible locks; it's spread out all over. Having a quick reference for what kinds of commands you'd be blocking with your transaction is valuable.

It's pretty evident that the pages have been programmatically generated, but I'd love know what it's generated from. I think you can derive this information from the documentation, but not sure if you can do it in an automated way without an LLM.

braiamp•12mo ago
> there isn't a single place in the Postgres documentation that lists all the possible locks

Did you read this page? https://www.postgresql.org/docs/current/explicit-locking.htm...

atombender•12mo ago
That's a great page, but it has several issues.

First, it isn't complete; as I said, the locking behaviour is spread out all over the Postgres documentation. For example, that page doesn't list what locks DROP INDEX takes. To find that out, you have to go to the documentation page for that command and read it carefully. In fact, really carefully — the locking behaviour is only documented under the section about CONCURRENTLY.

The page also doesn't list what possible commands are then blocked. Locks interact in subtle (and incorrectly named!) ways that are explained in the tables on that page ("Conflicting lock modes"), so to understand if something will block something else you have to look at the two commands you are curious about and then look at how their locks interact.

gulcin_xata•12mo ago
I agree, it is not so straightforward to find out.
braiamp•12mo ago
These are database locks, which means that depending which arrives first, the later transaction has to wait till the first one finishes to complete. These locks are about SQL commands and which commands can run concurrently with the others. There's a graph here of how that looks like https://pankrat.github.io/2015/django-migrations-without-dow...

Usually for maximum performance (minimum latency, maximum throughput) you want to have operations not lock each other, unless absolutely necessary, in which case you want them to be short.

whilenot-dev•12mo ago
You make it sound like the conflict is just affecting performance and won't result in a deadlock. So it's for performance aware postgres clients/users, and not for postgres developers?
andyferris•12mo ago
It is a guide for developers using postgres as a client, who need to write systems that don't deadlock, are performant and are correct. These are the (rather sharp) tools that postgres provides for doing so (or else you can use e.g. serializable isolation and optimistic concurrency, but in my experience that has too many false positives and bail out rather eagerly, whereas these tools let you be very precise and granular).
mebcitto•12mo ago
Other relevant talks/blogs that I found really useful for understanding Postgres locks are:

* Unlocking the Postgres Lock Manager by Bruce Momjian: https://momjian.us/main/writings/pgsql/locking.pdf

* Anatomy of table-level locks by Gulcin Yildirim Jelinek: https://xata.io/blog/anatomy-of-locks

pasxizeis•12mo ago
Shameless plug: I wrote a tool[1] that executes a given migration against a test database (e.g. in your CI) and reports back what locks it acquired.

The rationale being to have a "lock diagnostics report" commented in your PR's migration file.

It's a prototype and has a few rough edges and missing functionality, but feedback is more than welcome.

[1] https://github.com/agis/pglockanalyze

jononor•12mo ago
Very practical! Locking is one of the things that can really bite when doing migrations.

VoIP brings back old-fashioned pay phones to rural Vermont

https://spectrum.ieee.org/payphone-voip
29•bookofjoe•1h ago•1 comments

Mercurial, 20 years and counting: how are we still alive and kicking? [video]

https://fosdem.org/2026/schedule/event/AGWUVH-mercurial-aint-you-dead-yet/
113•ibobev•2d ago•84 comments

I turned a $80 RK3562 Android tablet into a Debian Linux workstation

https://github.com/tech4bot/rk3562deb
195•tech4bot•8h ago•101 comments

Multi-Species Canopy Latrines in Costa Rican Cloud Forests

https://onlinelibrary.wiley.com/doi/10.1002/ece3.72964
18•PaulHoule•3d ago•3 comments

The occasional ECONNRESET

https://movq.de/blog/postings/2026-05-05/1/POSTING-en.html
77•zdw•4h ago•18 comments

Magical Realism: “Northern Exposure” 25 Years Later (2015)

https://www.rogerebert.com/streaming/magical-realism-nothern-exposure-25-years-later
23•walterbell•1d ago•11 comments

Hindenburg’s Smoking Room

https://www.airships.net/hindenburg-smoking-room/
117•crescit_eundo•3d ago•63 comments

I don't think AI will make your processes go faster

https://frederickvanbrabant.com/blog/2026-05-15-i-dont-think-ai-will-make-your-processes-go-faster/
432•TheEdonian•9h ago•309 comments

Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

https://github.com/MinishLab/semble
49•Bibabomas•5h ago•18 comments

CUDA Books

https://github.com/alternbits/awesome-cuda-books
92•dariubs•8h ago•17 comments

High-Entropy Alloy

https://en.wikipedia.org/wiki/High-entropy_alloy
86•leonidasrup•3d ago•17 comments

Don’t Outsource the Learning

https://addyosmani.com/blog/dont-outsource-learning/
31•korecodes•5h ago•11 comments

Zerostack – A Unix-inspired coding agent written in pure Rust

https://crates.io/crates/zerostack/1.0.0
524•gidellav•23h ago•290 comments

Prolog Basics Explained with Pokémon

https://unplannedobsolescence.com/blog/prolog-basics-pokemon/
176•birdculture•2d ago•30 comments

Schanuel's Conjecture and the Semantics of Triton's FPSan

https://cp4space.hatsya.com/2026/05/03/schanuels-conjecture-and-the-semantics-of-fpsan/
13•c1ccccc1•1d ago•3 comments

Trials on veterans suggest ibogaine could provide a new treatment for PTSD

https://www.bbc.com/future/article/20260514-how-hallucinogenic-ibogaine-helps-veterans-overcome-ptsd
60•bushwart•9h ago•57 comments

Native all the way, until you need text

https://justsitandgrin.im/posts/native-all-the-way-until-you-need-text/
347•dive•9h ago•230 comments

AI is a technology not a product

https://daringfireball.net/2026/05/ai_is_technology_not_a_product
262•ch_sm•8h ago•97 comments

Scientists “bottle the sun” with a liquid battery that stores solar energy

https://www.sciencedaily.com/releases/2026/05/260513221821.htm
33•ndr42•2h ago•23 comments

Apple Silicon costs more than OpenRouter

https://www.williamangel.net/blog/2026/05/17/offline-llm-energy-use.html
267•datadrivenangel•9h ago•230 comments

Mozilla to UK regulators: VPNs are essential privacy and security tools

https://blog.mozilla.org/netpolicy/2026/05/15/mozilla-to-uk-regulators-vpns-are-essential-privacy...
577•WithinReason•15h ago•250 comments

Colossus: The Forbin Project

https://en.wikipedia.org/wiki/Colossus:_The_Forbin_Project
200•doener•2d ago•74 comments

A nicer voltmeter clock

https://lcamtuf.substack.com/p/a-nicer-voltmeter-clock
299•surprisetalk•22h ago•37 comments

XS: A programming language. Anywhere, anytime, by anyone

https://xslang.org
52•yacin•6h ago•33 comments

Tesla Solar Roof is on life support as it pivot to panels

https://electrek.co/2026/05/14/tesla-solar-roof-promise-vs-reality-pivot-panels/
104•celsoazevedo•17h ago•104 comments

How diamonds are made

https://diamond.jaydip.me/
73•lemonberry•1d ago•49 comments

OpenAI and Government of Malta partner to roll out ChatGPT Plus to all citizens

https://openai.com/index/malta-chatgpt-plus-partnership/
309•bookofjoe•1d ago•317 comments

C++26 Shipped a SIMD Library Nobody Asked For

https://lucisqr.substack.com/p/c26-shipped-a-simd-library-nobody
177•signa11•2d ago•145 comments

Hosting a website on an 8-bit microcontroller

https://maurycyz.com/projects/mcusite/
222•zdw•20h ago•19 comments

Mado: Fast Markdown linter written in Rust

https://github.com/akiomik/mado
52•nateb2022•3d ago•2 comments