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.

A few questions for the guy who went snorkeling in a Home Depot retention pond

https://www.vox.com/down-to-earth/511999/home-depot-retention-pond-snorkel-joseph-ricketts
119•gumby•1h ago•28 comments

Google Releases Cogentic Papers on Integer Factorization, Discrete Logs and More

https://github.com/google-research/google-research/tree/master/cogentic_research_papers
216•rgwohlbold•2h ago•179 comments

Investigating degraded experiences across GitHub products

https://www.githubstatus.com/incidents/qn8mfv6q5hlx
29•pinjasaur•19m ago•7 comments

Windows Loudness Equalization, reverse-engineered and ported to PipeWire

https://github.com/xoxorwr/pw-loudness-eq
204•ThrowNotAway•4h ago•121 comments

Button Sounds – collection of professionally-recorded button clicks and presses

https://buttons.joshwcomeau.com/
666•gaurang_tandon•12h ago•106 comments

Matrix Multiplication is Θ(n^2.25) [pdf]

https://github.com/openai/math/blob/main/preprints/The-matrix-multiplication-exponent-is-nine-fou...
856•E-Reverance•14h ago•470 comments

The short age of dragon riders

https://atilloy.com/2026/11/16/the-short-age-of-dragon-riders/
195•synapsomorphy•2d ago•115 comments

U.S. jury convicts Huawei of fraud, Iran sanctions violations

https://www.upi.com/Top_News/US/2026/11/25/jury-convicts-Huawei/3151795587204/
103•nephihaha•2h ago•93 comments

Porting Rockbox to an Undocumented $9 Aliexpress 'YP3' MP3 Player with LLMs

https://jayd.ml/2026/11/14/rockbox-on-yp3.html
22•jaydenmilne•1d ago•3 comments

Models Can Communicate via Inference Servers Despite Being Sandboxed

https://www.lesswrong.com/posts/7wzWuLP3HhyBLmKfo/models-can-communicate-via-inference-servers-de...
367•gmays•13h ago•152 comments

Show HN: Old Nvidia and ATI tech demos, running again in the browser

https://gpu-demo-gallery.pages.dev/
261•arkits•11h ago•55 comments

Getting old Java phones online again

https://antcating.github.io/2026/11/23/getting-old-java-phones-online-again.html
128•waximabbax•1d ago•58 comments

Predicting LoRA size for any dataset

https://engram.com/blog/lora-size
4•jxmorris12•17h ago•0 comments

Bypassing iOS Safari's 60 FPS Limit to Build Web Applications That Feel Native

https://rida.dev/blog/bypassing-ios-safari-60-fps-limit
350•vinhnx•13h ago•124 comments

Hazel (YC W24) Is Hiring a Product Designer

https://www.ycombinator.com/companies/hazel-2/jobs/8EhsvYE-product-designer-contract
1•augustschen•4h ago

Rumors swirling that labs might have cracked Factoring in P

https://www.reddit.com/r/singularity/comments/1y59ef1/rumor_that_openai_or_anthropic_found_a_way_to/
80•lilytweed•1h ago•37 comments

Ternary Bonsai 2.5 27B

https://prismml.com/news/bonsai-2-5-27b
509•b0m•20h ago•158 comments

Pinocchio at 200: a tale of hunger, greed and Italy's culinary history

https://www.repubblica.it/en/europe/food-travel/2026/11/24/news/carlo_collodi_pinocchio_pellegrin...
22•simonebrunozzi•1d ago•0 comments

Taking over US Treasury subdomains for $3 each

https://www.intruder.io/research/taking-over-us-treasury-subdomains-for-3-each
178•negura•11h ago•38 comments

PenGPT: A Generative Transformer for Handwriting and Sketches

https://greydanus.github.io/2026/11/12/pengpt/
348•smusamashah•15h ago•62 comments

Launch HN: Versine (YC F26) – MCP to send and receive money

97•harshithl1777•19h ago•90 comments

Marginalia Search, Money, C++, Rust, AI, Stuff

https://www.marginalia.nu/log/a_141_marginalia_update/
190•Curiositry•12h ago•78 comments

The Spray Bottle

https://mechanical-pencil.com/products/spray-bottle
568•vinhnx•3d ago•137 comments

The Shapes of Rivers

https://dominicroye.github.io/shapes-of-rivers/
118•joexov•1d ago•30 comments

The algebra of dependent types (2025)

https://dotat.at/@/2025-05-28-types.html
81•todsacerdoti•1d ago•11 comments

GPT-6 models demonstrate intrinsic protein-design capabilities

https://openai.com/index/gpt-6-models-demonstrate-intrinsic-protein-design-capabilities/
324•acossta•19h ago•92 comments

When in Doubt, Flail About

https://www.seangoedecke.com/when-in-doubt-flail-about/
94•zdw•2d ago•39 comments

Macrohistory in Six Facts

https://basilhalperin.com/essays/macrohistory.html
120•tptacek•13h ago•65 comments

Top open problems in mathematics ranked by LLM-assessed importance

https://www.proofatlas.ai/open-problems/
88•ijidak•13h ago•48 comments

Serving Qwen via AWS Lambdas for fun and 80x negative profit

https://noahbuilt.it/writing/qwen-on-5600-lambdas
118•octember•12h ago•17 comments