frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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.

GitHub Actions down again today

https://www.githubstatus.com/?today
422•cebert•3h ago•210 comments

Using AI to write better code more slowly

https://nolanlawson.com/2026/05/25/using-ai-to-write-better-code-more-slowly/
879•signa11•15h ago•338 comments

Opaque Types in Python

https://blog.glyph.im/2026/05/opaque-types-in-python.html
35•lumpa•3d ago•0 comments

C64 Basic: Game Map Overhead "Camera View"

https://retrogamecoders.com/overhead-camera-view/
8•ibobev•57m ago•0 comments

Netherlands blocks US takeover of vital digital supplier

https://www.politico.eu/article/netherlands-blocks-us-takeover-vital-digital-supplier/
209•vrganj•2h ago•65 comments

DynIP – Dynamic DNS with RFC 2136, IPv6, DNSSEC, and BYOD

https://dynip.dev/
213•dynip•7h ago•92 comments

Eagle 3.1: Collaboration Between the EAGLE Team, vLLM Team, and TorchSpec Team

https://vllm.ai/blog/2026-05-26-eagle-3-1
35•berlianta•2h ago•14 comments

Outsourcing plus LocalAI will soon become more economical vs. Frontier labs

https://www.signalbloom.ai/posts/outsourcing-plus-localai-will-soon-become-more-economical-vs-fro...
46•GodelNumbering•2h ago•45 comments

Taking a walk may lead to more creativity than sitting, study finds (2014)

https://www.apa.org/news/press/releases/2014/04/creativity-walk
433•bilsbie•16h ago•181 comments

Incident with Actions and Pages

https://www.githubstatus.com/incidents/gnftqj9htp0g
45•hakube•3h ago•11 comments

Phantasy Star IV – 1993 Developer Interviews

https://shmuplations.com/phantasystariv/
72•speckx•4d ago•33 comments

Don't put aria-label on generic elements like divs

https://www.matuzo.at/blog/2026/aria-label-generic-elements
39•cyanbane•3d ago•22 comments

How Shamir's Secret Sharing Works

https://ente.com/blog/how-shamirs-secret-sharing-works/
292•subract•16h ago•50 comments

Trying to preserve other peoples code

https://github.com/Essenceia/CRC_generator/tree/main
6•random__duck•3d ago•2 comments

How do you build a semiconductor company on something that's free?

https://www.siliconimist.com/p/the-open-source-silicon-business
34•johncole•4d ago•2 comments

Spain blocks prediction markets Polymarket, Kalshi over lack of gambling licence

https://www.reuters.com/business/spain-blocks-prediction-markets-polymarket-kalshi-over-lack-gamb...
34•thm•1h ago•10 comments

Ferrari Luce

https://www.ferrari.com/en-EN/auto/ferrari-luce
364•jumploops•17h ago•683 comments

A successful Japanese trial of a ramjet engine designed for Mach‑5 aircraft

https://www.bgr.com/2178211/japan-hypersonic-engine-ramjet-2-hour-flights-to-us/
206•rmason•19h ago•153 comments

Earthion: A New Mega Drive-Style Shoot-Em-Up

https://earthiongame.com/
105•MrBuddyCasino•11h ago•50 comments

What we lost when we stopped letting kids leave the front yard

https://stevemagness.substack.com/p/the-cost-of-safetyism
373•obscurette•1d ago•376 comments

Exit IP VPN servers mitigation rollout

https://mullvad.net/en/help/exit-ip-vpn-servers-mitigation-rollout
396•Cider9986•20h ago•74 comments

Exposing Critical Vulnerabilities in CBSE's On-Screen Marking Portal

https://ni5arga.com/blog/posts/hacking-cbse/
28•dsr12•5h ago•3 comments

Toshifumi Suzuki, founder of Seven-Eleven Japan, has died

https://www.referenceforbusiness.com/biography/S-Z/Suzuki-Toshifumi-1932.html
242•L_Rahman•22h ago•96 comments

Multimodal adaptive optical microscope: in vivo imaging, molecules to organisms

https://www.nature.com/articles/s41592-026-03066-1
37•bookofjoe•3d ago•1 comments

Uber president says AI spending is getting 'harder to justify'

https://www.theverge.com/transportation/937116/uber-ai-investment-hard-to-justify
67•berlianta•4h ago•16 comments

Motorola phones have started hijacking the Amazon app to insert affiliate codes

https://9to5google.com/2026/05/25/motorola-amazon-app-hijacking-behavior/
293•Cider9986•10h ago•149 comments

California moves to exempt Linux from its age-verification law after backlash

https://www.tomshardware.com/software/linux/california-moves-to-exempt-linux-from-its-upcoming-ag...
976•rbanffy•20h ago•426 comments

Norway's 2 petabytes of Huawei flash storage and LLM training

https://www.blocksandfiles.com/flash/2026/05/22/norways-2-petabytes-of-huawei-flash-storage-and-l...
303•rbanffy•19h ago•195 comments

Hacker News front page as a site

https://thefrontpage.dev/
368•thatxliner•18h ago•102 comments

Weave (YC W25) is hiring ML, AI, product, & design engineers

https://jobs.ashbyhq.com/workweave
1•adchurch•20h ago