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.

Anthropic acquires Bun

https://bun.com/blog/bun-joins-anthropic
947•ryanvogel•3h ago•462 comments

100k TPS over a billion rows: the unreasonable effectiveness of SQLite

https://andersmurphy.com/2025/12/02/100000-tps-over-a-billion-rows-the-unreasonable-effectiveness...
196•speckx•3h ago•67 comments

Claude 4.5 Opus' Soul Document

https://simonwillison.net/2025/Dec/2/claude-soul-document/
149•the-needful•2h ago•73 comments

Paged Out

https://pagedout.institute
51•varjag•1h ago•2 comments

Amazon launches Trainium3

https://techcrunch.com/2025/12/02/amazon-releases-an-impressive-new-ai-chip-and-teases-a-nvidia-f...
67•thnaks•2h ago•28 comments

I designed and printed a custom nose guard to help my dog with DLE

https://snoutcover.com/billie-story
272•ragswag•2d ago•35 comments

Delty (YC X25) Is Hiring

https://www.ycombinator.com/companies/delty/jobs/aPWMaiq-full-stack-software-engineer
1•lalitkundu•24m ago

OpenAI declares 'code red' as Google catches up in AI race

https://www.theverge.com/news/836212/openai-code-red-chatgpt
254•goplayoutside•6h ago•314 comments

Learning music with Strudel

https://terryds.notion.site/Learning-Music-with-Strudel-2ac98431b24180deb890cc7de667ea92
318•terryds•6d ago•78 comments

Cursed circuits: charge pump voltage halver

https://lcamtuf.substack.com/p/cursed-circuits-charge-pump-voltage
32•surprisetalk•2h ago•4 comments

Free static site generator for small restaurants and cafes

https://lite.localcafe.org/
17•fullstacking•1h ago•7 comments

All about automotive lidar

https://mainstreetautonomy.com/blog/2025-08-29-all-about-automotive-lidar/
30•dllu•1d ago•8 comments

School Cell Phone Bans and Student Achievement (NBER Digest)

https://www.nber.org/digest/202512/school-cell-phone-bans-and-student-achievement
43•harias•3h ago•38 comments

Zig's new plan for asynchronous programs

https://lwn.net/SubscriberLink/1046084/4c048ee008e1c70e/
153•messe•6h ago•113 comments

Solving the Partridge Packing Problem Using MiniZinc

https://zayenz.se/blog/post/partridge-packing/
12•mzl•6d ago•0 comments

The Junior Hiring Crisis

https://people-work.io/blog/junior-hiring-crisis/
140•mooreds•3h ago•160 comments

Mistral 3 family of models released

https://mistral.ai/news/mistral-3
568•pember•6h ago•175 comments

YesNotice

https://infinitedigits.co/docs/software/yesnotice/
128•surprisetalk•1w ago•48 comments

Code Wiki: Accelerating your code understanding

https://developers.googleblog.com/en/introducing-code-wiki-accelerating-your-code-understanding/
24•geoffbp•6d ago•6 comments

Addressing the adding situation

https://xania.org/202512/02-adding-integers
234•messe•9h ago•78 comments

Advent of Compiler Optimisations 2025

https://xania.org/202511/advent-of-compiler-optimisation
306•vismit2000•11h ago•52 comments

Nixtml: Static website and blog generator written in Nix

https://github.com/arnarg/nixtml
72•todsacerdoti•6h ago•31 comments

Python Data Science Handbook

https://jakevdp.github.io/PythonDataScienceHandbook/
172•cl3misch•8h ago•35 comments

Apple Releases Open Weights Video Model

https://starflow-v.github.io
412•vessenes•16h ago•146 comments

Lowtype: Elegant Types in Ruby

https://codeberg.org/Iow/type
51•birdculture•4d ago•27 comments

What will enter the public domain in 2026?

https://publicdomainreview.org/features/entering-the-public-domain/2026/
457•herbertl•18h ago•321 comments

A series of vignettes from my childhood and early career

https://www.jasonscheirer.com/weblog/vignettes/
126•absqueued•8h ago•84 comments

Show HN: Marmot – Single-binary data catalog (no Kafka, no Elasticsearch)

https://github.com/marmotdata/marmot
82•charlie-haley•6h ago•19 comments

YouTube increases FreeBASIC performance (2019)

https://freebasic.net/forum/viewtopic.php?t=27927
149•giancarlostoro•2d ago•38 comments

Beej's Guide to Learning Computer Science

https://beej.us/guide/bglcs/
335•amruthreddi•2d ago•126 comments