frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Pglocks.org

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

Comments

whilenot-dev•6mo 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•6mo 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•6mo 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•6mo 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•6mo 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•6mo ago
I agree, it is not so straightforward to find out.
braiamp•6mo 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•6mo 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•6mo 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•6mo 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•6mo 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•6mo ago
Very practical! Locking is one of the things that can really bite when doing migrations.

Modern Cassette Walkmans

https://walkman.land/modern
24•classichasclass•27m ago•0 comments

The universal weight subspace hypothesis

https://arxiv.org/abs/2512.05117
185•lukeplato•5h ago•63 comments

The web runs on tolerance

https://shkspr.mobi/blog/2025/12/the-web-runs-on-tolerance/
50•speckx•4d ago•40 comments

Show HN: I built a system for active note-taking in regular meetings like 1-1s

https://withdocket.com
21•davnicwil•7h ago•2 comments

Icons in Menus Everywhere – Send Help

https://blog.jim-nielsen.com/2025/icons-in-menus/
323•ArmageddonIt•9h ago•129 comments

Kroger acknowledges that its bet on robotics went too far

https://www.grocerydive.com/news/kroger-ocado-close-automated-fulfillment-centers-robotics-grocer...
109•JumpCrisscross•5h ago•97 comments

Jepsen: NATS 2.12.1

https://jepsen.io/analyses/nats-2.12.1
318•aphyr•10h ago•115 comments

Horses: AI progress is steady. Human equivalence is sudden

https://andyljones.com/posts/horses.html
255•pbui•4h ago•164 comments

The Lost Machine Automats and Self-Service Cafeterias of NYC (2023)

https://www.untappedcities.com/automats-cafeterias-nyc/
45•walterbell•4h ago•16 comments

Strong earthquake hits northern Japan, tsunami warning issued

https://www3.nhk.or.jp/nhkworld/en/news/20251209_02/
277•lattis•14h ago•139 comments

OSHW: Small tablet based on RK3568 and AMOLED screen

https://oshwhub.com/oglggc/rui-xin-wei-rk3568-si-ceng-jia-li-chuang-mian-fei-gong-yi
40•thenthenthen•5d ago•10 comments

AMD GPU Debugger

https://thegeeko.me/blog/amd-gpu-debugging/
225•ibobev•13h ago•36 comments

Let's put Tailscale on a jailbroken Kindle

https://tailscale.com/blog/tailscale-jailbroken-kindle
251•Quizzical4230•12h ago•61 comments

Microsoft increases Office 365 and Microsoft 365 license prices

https://office365itpros.com/2025/12/08/microsoft-365-pricing-increase/
298•taubek•15h ago•357 comments

Scientific and Technical Amateur Radio

https://destevez.net/
36•gballan•4h ago•3 comments

IBM to acquire Confluent

https://www.confluent.io/blog/ibm-to-acquire-confluent/
366•abd12•15h ago•292 comments

Hunting for North Korean Fiber Optic Cables

https://nkinternet.com/2025/12/08/hunting-for-north-korean-fiber-optic-cables/
233•Bezod•12h ago•67 comments

Has the cost of building software dropped 90%?

https://martinalderson.com/posts/has-the-cost-of-software-just-dropped-90-percent/
212•martinald•10h ago•360 comments

Trials avoid high risk patients and underestimate drug harms

https://www.nber.org/papers/w34534
88•bikenaga•10h ago•32 comments

Everything that is wrong in museums starts with wall labels

https://www.aaronland.info/weblog/2025/11/20/cafeteria/
13•panic•6d ago•5 comments

Cassette tapes are making a comeback?

https://theconversation.com/cassette-tapes-are-making-a-comeback-yes-really-268108
57•devonnull•5d ago•84 comments

Latency Profiling in Python: From Code Bottlenecks to Observability

https://quant.engineering/latency-profiling-in-python.html
23•rundef•6d ago•5 comments

Paramount launches hostile bid for Warner Bros

https://www.cnbc.com/2025/12/08/paramount-skydance-hostile-bid-wbd-netflix.html
272•gniting•15h ago•265 comments

AI should only run as fast as we can catch up

https://higashi.blog/2025/12/07/ai-verification/
130•yuedongze•11h ago•121 comments

Show HN: Fanfa – Interactive and animated Mermaid diagrams

https://fanfa.dev/
79•bairess•4d ago•16 comments

Microsoft Download Center Archive

https://legacyupdate.net/download-center/
134•luu•3d ago•17 comments

A series of tricks and techniques I learned doing tiny GLSL demos

https://blog.pkh.me/p/48-a-series-of-tricks-and-techniques-i-learned-doing-tiny-glsl-demos.html
155•ibobev•12h ago•17 comments

Launch HN: Nia (YC S25) – Give better context to coding agents

https://www.trynia.ai/
96•jellyotsiro•12h ago•70 comments

Nova Programming Language

https://nova-lang.net
96•surprisetalk•14h ago•49 comments

No more O'Reilly subscriptions for me

https://zerokspot.com/weblog/2025/12/05/no-more-oreilly-subscriptions-for-me/
136•speckx•13h ago•121 comments