frontpage.
newsnewestaskshowjobs

Open Source @Github

fp.

Open in hackernews

Pglocks.org

https://pglocks.org/
80•hnasr•1y ago

Comments

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

Shopify is moving from React Native back to Swift and Kotlin

https://shopify.engineering/back-to-native
856•fnthawar2•13h ago•575 comments

More questions about whether researchers can trust OpenAI with unpublished math

https://mathstodon.xyz/@andreasthom/117240535270608201
731•pred_•20h ago•674 comments

YuE2 · Frontier Music with Symbolic Planning

https://map-yue2.github.io/
61•sexy_seedbox•3h ago•48 comments

OpenAI Agents API

https://developers.openai.com/api/docs/guides/agents-api/overview
171•aquir•8h ago•104 comments

Thelio Mira AI Linux Workstation: 192 GB GPU Memory

https://system76.com/workstations/thelio-mira-ai
57•jonifico•4h ago•34 comments

Don't let anyone take away your big box of cables

https://blog.jim-nielsen.com/2026/hands-off-my-cables/
365•Brajeshwar•12h ago•273 comments

Mexican student creates an acoustic fire extinguisher to put out fire in seconds

https://www.upsocl.com/en/16-year-old-mexican-student-creates-an-acoustic-fire-extinguisher-that-...
76•rguiscard•2h ago•31 comments

Cognition launches new SWE-2 model, Rivaling Fable 5.1 and GPT-Astra

https://cognition.com/blog/swe-2
366•seelos•12h ago•155 comments

Google will buy half the electricity of a nuclear power plant

https://www.bbc.com/news/articles/c8r6y4me2g6o
120•lukaspetersson•3h ago•92 comments

Technique for Manipulating Satellite Photos Now Reveals Ancient Images (2025)

https://spinoff.nasa.gov/Manipulating_Satellite_Photos_Now_Reveals_Ancient_Images
287•gumby•12h ago•45 comments

The Deathray: A simple way for an untrusted site to freeze a Mac

https://auberon.xyz/blog/posts/deathray/
108•auberonedu•8h ago•69 comments

NTSB issues investigative update on B-767 runway excursion accident in Miami

https://www.ntsb.gov:443/news/press-releases/Pages/NR20260909.aspx
73•mckn1ght•6h ago•119 comments

Customizing my Compaq MX-11800 keyboard

https://blog.webb.page/WM-102
18•NetOpWibby•3d ago•4 comments

Music Theory for the 21st-Century Classroom

https://musictheory.pugetsound.edu/mt21c/MusicTheory.html
178•aanet•10h ago•80 comments

Neki – Sharded Postgres

https://planetscale.com/blog/introducing-neki
213•simon_weber•12h ago•114 comments

Proof of Capture: Apple Reference Image, but open source and using steganography

https://merybenavente.me/blog/proof-of-capture
76•merybenavente•8h ago•51 comments

Forgejo <=16.0.3 Critical RCE

https://codeberg.org/forgejo/forgejo/src/branch/forgejo/release-notes-published/16.0.4.md
156•weierstass•11h ago•57 comments

LLM Visualizer – Build a Transformer from Scratch

https://jayvisaria.github.io/LLM-Visualizer/#/dashboard
7•evo_9•57m ago•3 comments

Rust is tier-1 language at Microsoft

https://rustfoundation.org/media/guest-post-rust-is-tier-1-language-at-microsoft/
629•mmastrac•14h ago•359 comments

iPhone Duo

https://www.apple.com/iphone-duo/
1418•thecosmicfrog•1d ago•2452 comments

Hitachi launches CO2 heat pump water heaters with solar-friendly tariff controls

https://www.pv-magazine.com/2026/09/07/hitachi-launches-co2-heat-pump-water-heaters-with-solar-fr...
289•thelastgallon•1d ago•236 comments

Show HN: Algo-Trading-Skills - 501 agent skills for trading infrastructure

https://github.com/HimanshuJ16/Algo-Trading-Skills
5•HimanshuJ16•1h ago•2 comments

JEP 544: Ahead-of-Time Code Compilation

https://openjdk.org/jeps/544
83•Skinney•10h ago•28 comments

Douglas Hofstadter: Analogy as the Core of Cognition [video]

https://www.youtube.com/watch?v=n8m7lFQ3njk
153•tosh•4d ago•75 comments

What happens when a GPU writes memory

https://blog.doubleword.ai/what-happens-when-a-gpu-writes-memory
54•ibobev•2d ago•1 comments

Recursion into madness

https://blog.coredump.cx/p/recursion-into-madness
49•surprisetalk•3d ago•14 comments

Detecting and countering misuse of AI: September 2026

https://www.anthropic.com/threat-intelligence-report-september-2026
97•garo-pro•10h ago•167 comments

Herdr Studio

https://powerfooI.github.io/herdr-studio/
11•throwaway888abc•2h ago•4 comments

Setting up OpenCode with Ollama and sbx on Mac

https://tensorsandtokens.com/posts/opencode-ollama/
12•etoxin•3h ago•8 comments

Bitap: My favorite string matching algorithm

https://jo3-l.dev/posts/bitap/
4•haeseong•2d ago•0 comments