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.

Google SWE points 48 AI agents at NASA Lidar, finds unmapped Maya pyramid in 72h

https://pietromiotti.com/latest/maya-site/?maya
473•eyvindn•3h ago•183 comments

Can a Linear Program Do Weight-Space Programming?

https://nathan.rs/posts/weight-space-lp/
108•emschwartz•2h ago•15 comments

Pharo in the Browser with WebAssembly

https://massimo-nocentini.github.io/pharo-vm/world.html
32•xkriva11•1h ago•7 comments

Atuin Threads: All your agent sessions on every machine

https://blog.atuin.sh/threads-agent-sessions/
24•linsomniac•1h ago•12 comments

Using voltage glitching to unleash the A100 in my mining card

https://blog.kate.land/posts/using-voltage-glitching-to-unlock-the-a100/
113•lae•4h ago•45 comments

Protecting SSH Keys with macOS Secure Enclave

https://gatezh.com/posts/macos-secure-enclave-ssh-keys/
317•js2•10h ago•112 comments

I asked every TV manufacturer 17 questions about how they spy on you

https://www.theverge.com/tech/1012372/tv-privacy-acr-questions
86•Brajeshwar•1h ago•36 comments

Next-Level Benchmarking Overfitting – Thomas Neumann

http://databasearchitects.blogspot.com/2026/11/next-level-benchmarking-overfitting.html
38•artrax•3h ago•4 comments

Show HN: Godbolt-in-a-floating-window for Neovim (C, C++, Rust)

https://github.com/0xdeadf1sh/AssemblyForNeovim
17•0xdeadf1sh•1h ago•1 comments

Apple is killing its Support Community forum next week

https://www.theverge.com/tech/1031507/apple-community-support-forum-shutting-down
54•saikatsg•1h ago•23 comments

We need more goat sacrifices

https://www.experimental-history.com/p/we-need-more-goat-sacrifices
45•iamnothere•2h ago•25 comments

In Defense of Giving a Shit

https://www.possibilityspace.org/blog/posts/in-defence-of-giving-a-shit/
24•mrkn1•3h ago•4 comments

Peer-to-peer WebRTC connections with built-in signaling and discovery

https://github.com/lukks/like-webrtc
16•LuKks•2d ago•6 comments

Tinfoil (YC P25) is hiring an applied AI security engineer in San Francisco

1•FrasiertheLion•3h ago

Apple has new Mac app coming to make running local AI models easy

https://9to5mac.com/2026/11/10/apple-has-new-mac-app-coming-to-make-running-local-ai-models-easy/
409•linolevan•17h ago•422 comments

Scion is back and is going to sell a kei truck in America

https://www.theautopian.com/scion-is-back-and-its-going-to-sell-a-freaking-kei-truck-in-america/
524•NaOH•19h ago•355 comments

Open research, stronger privacy: Making Firefox users harder to fingerprint

https://blog.mozilla.org/security/2026/11/10/open-research-stronger-privacy-making-firefox-users-...
69•Vinnl•2h ago•8 comments

EventSourcingDB 1.3.0 Is Available

https://www.eventfoundation.io/resources/blog/eventsourcingdb-1-3-0-is-available
10•goloroden•2h ago•0 comments

Physically Controllable Relighting of Photographs

https://yaksoy.github.io/PhysicalRelighting/
34•summarity•3h ago•5 comments

The Afterlife of the Berlin Wall

https://www.historytoday.com/miscellanies/afterlife-berlin-wall
4•pepys•1d ago•0 comments

Greg Kurtzer's Ginux is now a userspace kernel

https://github.com/gmkurtzer/ginux
102•d3Xt3r•9h ago•62 comments

Six Math Essentials

https://teorth.github.io/tao-web/six-math-essentials.html
301•digital55•18h ago•57 comments

Make this forward pass as fast as possible

https://ianbarber.blog/2026/11/09/make-this-forward-pass-as-fast-as-possible/
18•matt_d•1d ago•1 comments

Starlink Mini 2

https://starlink.com/mini-2
478•robertjfclarke•21h ago•520 comments

Synaptics patent claims stop work on DisplayLink drivers

https://lwn.net/SubscriberLink/1102549/acbc92e00cee3a3f/
449•speckx•21h ago•256 comments

A great old-timey game-programming hack (2013)

https://blog.moertel.com/posts/2013-12-14-great-old-timey-game-programming-hack.html
223•palsecam•13h ago•46 comments

Why I wrote the BEAM book (2025)

https://happihacking.com/blog/posts/2025/why_I_wrote_theBEAMBook/
151•zenincognito•1d ago•26 comments

Show HN: Black Ops II statically recompiled to native ARM64 macOS

https://github.com/adrbn/bo2-mac
90•adrbn•10h ago•40 comments

Why Amstrad chose the 3" drives

https://www.cpcwiki.eu/forum/amstrad-cpc-hardware/why-amstrad-chose-the-3-drives/
73•Skyfall106•5d ago•28 comments

Hyper-Realistic Sand with WebGL2

https://av.github.io/safe-sand/
4•everlier•1h ago•0 comments