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.

The Lost Treasure of Sid Meier's Pirates

https://remapradio.com/articles/the-lost-treasure-of-sid-meiers-pirates/
50•spankibalt•1h ago•13 comments

We Rebuilt the Linux MicroVM Stack on Apple Silicon

https://encore.dev/blog/firecracker-apple-silicon
47•signa11•2h ago•10 comments

The August 17 outage

https://github.blog/news-insights/company-news/the-august-17-outage-and-the-work-ahead/
509•0xedb•13h ago•573 comments

I like 'em thick: an apology to my English teachers

https://www.experimental-history.com/p/i-like-em-thick
723•Ariarule•2d ago•296 comments

The case against a C alternative (2022)

https://c3.handmade.network/blog/p/8486-the_case_against_a_c_alternative
11•theanonymousone•4d ago•1 comments

HTML Can Do That

https://chrisburnell.com/html-can-do-that/
785•encyclopedism•1d ago•188 comments

Version Control for Everything

https://tyoverby.com/posts/version-control-for-everything-else/
31•evakhoury•3d ago•19 comments

Malicious Rust crate Arrayref runs a build-time payload

https://safedep.io/arrayref-proc-macro1-rust-build-time-malware/
489•abhisek•19h ago•418 comments

Ox Alpha

https://openrouter.ai/stealth/ox-alpha
140•mtokmak06•9h ago•104 comments

I should have loved biology (2020)

https://jsomers.net/i-should-have-loved-biology/
278•tyre•15h ago•106 comments

The Religious Experience of Philip K. Dick by R. Crumb (1986)

https://philipdick.com/resources/miscellaneous/the-religious-experience-of-philip-k-dick-by-r-cru...
29•wise_blood•3h ago•11 comments

Japan tried to build an operating system for the world, the US intervened

https://www.xda-developers.com/japan-tried-build-operating-system-entire-world-us-government-inte...
119•rdmuser•3h ago•59 comments

CIA funding helped keep NeXT afloat in the 80s

https://www.wsj.com/tech/steve-jobs-apple-next-cia-161b65f9?st=NWWds1&reflink=desktopwebshare_per...
394•EwanG•1d ago•242 comments

Why aren't smart people happier? (2022)

https://www.experimental-history.com/p/why-arent-smart-people-happier
166•rafaelc•14h ago•245 comments

Launch HN: Vendo (YC S26) – Let users build features on top of your product

https://github.com/runvendo/vendo
34•yousefh409•17h ago•19 comments

Show HN: Huzzah – a novel approach to coding with AI

https://www.danielvaughn.dev/posts/huzzah/
303•danielvaughn•13h ago•158 comments

Micron announces $10B research hub in Boise

https://investors.micron.com/news/press-release/2026/Micron-Unveils-Micron-Research-Labs-a-U-S--B...
14•osnium123•5h ago•1 comments

Vomit: Clean up Claude 5's token output with a separate LLM

https://github.com/zachahn/vomit
250•Bluestein•17h ago•245 comments

Captain Zilog

https://www.zilog.com/captain_zilog/
51•rbanffy•3d ago•6 comments

Make a 6-Tesla-class high-temperature superconducting dipole magnet at 4.2 K

https://journals.aps.org/prab/abstract/10.1103/4nhs-bkwh
39•supermagnet•6d ago•10 comments

Seed: Minimal, self-modifying agent harness

https://github.com/vivekhaldar/seed
18•gandalfgeek•3h ago•8 comments

Linux 7.2

https://www.igalia.com/2026/08/19/Linux-72-Released.html
249•mariuz•17h ago•97 comments

Codex on AWS bedrock bug causing 10x charges

https://github.com/openai/codex/issues/37674
130•TheP1000•5h ago•43 comments

AliExpress runs silent WebAudio fingerprinting that breaks Bluetooth multipoint

https://blog.laserphile.com/2026/08/aliexpress-webpage-keeping-multipoint.html
960•emctech•22h ago•299 comments

Show HN: Argentic – An L402 Lightning toll booth for AI scraping agents

https://Argentic.network
7•Ag0146•2h ago•4 comments

Emacs 31.1 will release on 8/24

https://github.com/emacs-mirror/emacs/blob/062dcd2aead00c3b47c14ff5b6c40313f7a775f5/etc/HISTORY
10•birdculture•44m ago•0 comments

Stop Anthropomorphizing Intermediate Tokens as Reasoning/Thinking Traces (2025)

https://arxiv.org/abs/2504.09762
230•nunodonato•1d ago•163 comments

Anti-AI fonts are useless and harmful

https://blog.yaros.ae/anti-ai-fonts-are-useless-and-harmful/
160•speckx•17h ago•114 comments

AI companies destroy physical books – let's scan rare books before it's too late

https://annas-archive.gl/blog/physical-destruction.html
317•Cider9986•6h ago•228 comments

Speeding Up (Small) Ruby Hashes

https://byroot.github.io/ruby/performance/2026/08/13/speeding-up-ruby-hashes.html
51•arto•1w ago•0 comments