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.

Why is Google still serving dodgy ads?

https://www.atomic14.com/2026/09/13/why-is-google-still-serving-dodgy-ads
297•iamflimflam1•2h ago•142 comments

Mark Zuckerberg: "Cambridge Analytica" (2017)

https://twitter.com/TechEmails/status/2099214399840059428
42•mfiguiere•28m ago•2 comments

Astra and Fable still hack on simple variants of alignment evals from 2025

https://www.lesswrong.com/posts/munJKF7iWMsWJLAH2/astra-and-fable-still-hack-on-simple-variants-o...
298•Levitating•6h ago•133 comments

Global Shortage Has Led to Motor Oil Rationing at Costco

https://guessingheadlights.com/global-shortage-has-led-to-motor-oil-rationing-at-costco/
94•mikhael•2h ago•67 comments

There Is No AI (It's Just People) with Jaron Lanier

https://singjupost.com/startalk-there-is-no-ai-really-its-just-people-w-jaron-lanier-transcript/
22•andsoitis•55m ago•7 comments

Julia 1.13 Highlights

https://julialang.org/blog/2026/09/julia-1.13-highlights/
33•eigenspace•3d ago•2 comments

Data collected by cars and sold to third parties

https://www.theverge.com/column/994172/your-car-is-selling-your-data
178•bookofjoe•6h ago•103 comments

JetKVM Mini

https://jetkvm.com/blog/introducing-jetkvm-mini
462•taubek•12h ago•180 comments

Why is the x86 undefined instruction called ud2? Why 2?

https://devblogs.microsoft.com/oldnewthing/20260910-00/?p=112689
146•ibobev•8h ago•37 comments

Reverse engineering my e-scooter and rewriting the firmware in Rust

https://bensimms.moe/reverse-engineering-scooter/
277•vinhnx•3d ago•69 comments

Making Startups Powerful

https://paulgraham.com/powerful.html
93•tosh•6h ago•35 comments

Sean Carroll explains the biggest ideas in the universe – Full Interview [video]

https://www.youtube.com/watch?v=_TBNJyztai0
43•binyu•2d ago•7 comments

Device Drivers lab exercise – COSC562

https://web.eecs.utk.edu/~smarz1/courses/cosc562/drivers.html
14•azhenley•2h ago•1 comments

I'm being cyberattacked by Tesla, Inc

https://dreamstation.systems/personal/tesla.html
317•robinpie•2h ago•89 comments

CUDA for AMD on Windows

https://github.com/Speedstu/CUDA-for-AMD-Windows
104•chiassedu80•6h ago•59 comments

Why are AI agents lying, cheating and coordinating?

https://yoshuabengio.org/en/publication/why-are-ai-agents-lying-cheating-and-coordinating
536•jonifico•19h ago•618 comments

Reverse-Engineering Claude Web's MicroVM: Uncovering Anthropic's Hidden Antspace

https://aprilnea.me/en/blog/reverse-engineering-claude-code-antspace
22•rzk•2d ago•5 comments

Garry Tan wants US open-weight AI labs to 'distill' frontier models, too

https://techcrunch.com/2026/09/11/y-combinators-garry-tan-wants-u-s-open-weight-ai-labs-to-distil...
241•TheJCDenton•4h ago•124 comments

'Fingerprints' inside the Sun could reveal if it once swallowed a planet

https://ras.ac.uk/news-and-press/research-highlights/fingerprints-inside-sun-could-reveal-if-it-o...
97•blincoln•8h ago•37 comments

Libraries Run Rust Inside Python (With PyO3)

https://belderbos.dev/blog/how-libraries-run-rust-inside-python/
40•lumpa•5h ago•27 comments

Cpak – OCI application package format for Linux desktops, servers and devices

https://cpak.it/
33•xlmnxp•5h ago•11 comments

TailTalk: A modern async user space AppleTalk stack with Rust and Tokio

https://github.com/FeralFirmware/TailTalk/
57•zdw•20h ago•13 comments

Alan's Random Insult Generator (1999)

https://alanbellows.com/experiments/insult/index.html
58•DamnInteresting•2d ago•23 comments

Romania soccer introduces black card to 'combat abusive behaviour' from parents

https://www.nytimes.com/athletic/7586821/2026/09/12/football-black-card-referee/
69•thunderbong•3h ago•47 comments

David Sacks: OpenAI and Anthropic Don't Need Regulations to Pace Frontier Models

https://twitter.com/DavidSacks/status/2098973625252708460
163•kolanos•3h ago•121 comments

AI recursive self-improvement might not come so quickly after all (August 2026)

https://www.technologyreview.com/2026/08/18/1142188/ai-recursive-self-improvement/
18•dgellow•1h ago•13 comments

Make your first edit to OpenStreetMap

https://high5apps.github.io/josm-plugin-website-wizard/
578•juliantigler•1d ago•138 comments

Base84 deserves a place in file names

https://00f.net/2026/09/09/base84/
49•kevvok•2d ago•40 comments

Homebrew 7.0.0

https://brew.sh/2026/09/13/homebrew-7.0.0/
499•mikemcquaid•11h ago•196 comments

On Binary Translation and Its Consequences

https://chipsandcheese.com/p/on-binary-translation-and-its-consequences
42•matt_d•2d ago•16 comments