frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Pglocks.org

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

Comments

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

DaVinci Resolve releases Photo Editor

https://www.blackmagicdesign.com/products/davinciresolve/photo
374•thebiblelover7•4h ago•82 comments

A new spam policy for "back button hijacking"

https://developers.google.com/search/blog/2026/04/back-button-hijacking
226•zdw•4h ago•119 comments

Can Claude Fly a Plane?

https://so.long.thanks.fish/can-claude-fly-a-plane/
25•casi•38m ago•19 comments

Someone bought 30 WordPress plugins and planted a backdoor in all of them

https://anchor.host/someone-bought-30-wordpress-plugins-and-planted-a-backdoor-in-all-of-them/
873•speckx•13h ago•247 comments

Sometimes powerful people just do dumb shit

https://www.joanwestenberg.com/sometimes-powerful-people-just-do-dumb-shit/
142•zdw•4h ago•52 comments

Distributed DuckDB Instance

https://github.com/citguru/openduck
18•citguru•39m ago•2 comments

GitHub Stacked PRs

https://github.github.com/gh-stack/
641•ezekg•10h ago•351 comments

TanStack Start Now Support React Server Components

https://tanstack.com/blog/react-server-components
32•polywock•1h ago•21 comments

Lean proved this program correct; then I found a bug

https://kirancodes.me/posts/log-who-watches-the-watchers.html
216•bumbledraven•6h ago•107 comments

WiiFin – Jellyfin Client for Nintendo Wii

https://github.com/fabienmillet/WiiFin
133•throwawayk7h•7h ago•56 comments

Multi-Agentic Software Development Is a Distributed Systems Problem

https://kirancodes.me/posts/log-distributed-llms.html
12•tie-in•1h ago•2 comments

Roblox devs now need a subscription to share their games freely

https://devforum.roblox.com/t/new-publishing-requirements-evaluation-process-for-games/4573166
19•hallole•1h ago•4 comments

Design and implementation of DuckDB internals

https://duckdb.org/library/design-and-implementation-of-duckdb-internals/
101•mpweiher•3d ago•8 comments

Nothing Ever Happens: Polymarket bot that always buys No on non-sports markets

https://github.com/sterlingcrispin/nothing-ever-happens
402•m-hodges•15h ago•221 comments

Rust Threads on the GPU

https://www.vectorware.com/blog/threads-on-gpu/
45•PaulHoule•4d ago•13 comments

Anastasia (1997) live action reference material

https://lostmediawiki.com/Anastasia_(partially_found_live-action_reference_material_for_Don_Bluth...
15•hyperific•3d ago•3 comments

N-Day-Bench – Can LLMs find real vulnerabilities in real codebases?

https://ndaybench.winfunc.com
58•mufeedvh•9h ago•15 comments

US appeals court declares 158-year-old home distilling ban unconstitutional

https://nypost.com/2026/04/11/us-news/us-appeals-court-declares-158-year-old-home-distilling-ban-...
373•t-3•17h ago•251 comments

A soft robot has no problem moving with no motor and no gears

https://engineering.princeton.edu/news/2026/04/08/soft-robot-has-no-problem-moving-no-motor-and-n...
9•hhs•4d ago•0 comments

A name is succession, legacy and celebration in Japan's Kabuki theater

https://apnews.com/article/kabuki-name-succession-japan-tradition-theater-d1e9621bc91385498314f36...
3•mooreds•3d ago•0 comments

Write less code, be more responsible

https://blog.orhun.dev/code-responsibly/
71•orhunp_•2d ago•41 comments

UpDown: Efficient Manycore based on Many Threading & Scalable Memory Parallelism

https://people.cs.uchicago.edu/~aachien/lssg/research/10x10/ics26-single-chip-updown.pdf
7•matt_d•1h ago•0 comments

Make tmux pretty and usable (2024)

https://hamvocke.com/blog/a-guide-to-customizing-your-tmux-conf/
355•speckx•16h ago•223 comments

How to make Firefox builds 17% faster

https://blog.farre.se/posts/2026/04/10/caching-webidl-codegen/
164•mbitsnbites•12h ago•30 comments

Building a CLI for all of Cloudflare

https://blog.cloudflare.com/cf-cli-local-explorer/
293•soheilpro•15h ago•97 comments

I shipped a transaction bug, so I built a linter

https://leonh.fr/posts/go-transaction-linter/
32•leonhfr•3d ago•4 comments

Math Is Still Catching Up to the Mysterious Genius of Srinivasa Ramanujan (2024)

https://www.quantamagazine.org/srinivasa-ramanujan-was-a-genius-math-is-still-catching-up-20241021/
46•paulpauper•2h ago•1 comments

Android now stops you sharing your location in photos

https://shkspr.mobi/blog/2026/04/android-now-stops-you-sharing-your-location-in-photos/
346•edent•19h ago•295 comments

I just want simple S3

https://blog.feld.me/posts/2026/04/i-just-want-simple-s3/
149•g0xA52A2A•2d ago•81 comments

Air Powered Segment Display? [video]

https://www.youtube.com/watch?v=E1BLGpE5zH0
93•ProfDreamer•2d ago•11 comments