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.

Search engines alternatives now that Google isn't Google anymore

https://techcrunch.com/2026/05/21/six-search-engines-worth-trying-now-that-google-isnt-really-goo...
253•elorant•1h ago•196 comments

Magnifica Humanitas (Encyclical Letter)

https://www.vatican.va/content/leo-xiv/en/encyclicals/documents/20260515-magnifica-humanitas.html
363•theletterf•4h ago•133 comments

Leave Me Behind

http://androidessence.com/leave-me-behind/
129•mooreds•2h ago•80 comments

2026 HIPAA Security Rule Update

https://medcurity.com/hipaa-security-rule-2026-update/
13•mooreds•30m ago•0 comments

Pope Leo XIV says AI must serve humanity, not the powerful few

https://religionnews.com/2026/05/25/in-his-first-encyclical-pope-leo-xiv-says-ai-must-serve-human...
93•benwerd•1h ago•27 comments

IBM Spins Off the First Pure-Play Quantum Chip Foundry

https://futurumgroup.com/insights/2-billion-chips-act-investment-in-quantum-bets-on-ibms-300mm-su...
56•rbanffy•4h ago•13 comments

Netherlands Seizes 800 Servers, Arrests 2 for Aiding Cyberattacks

https://krebsonsecurity.com/2026/05/netherlands-seizes-800-servers-arrests-2-for-aiding-cyberatta...
6•jruohonen•29m ago•0 comments

C extensions, portability, and alternative compilers

https://lemon.rip/w/6-c-extensions-compilers/
3•xngbuilds•11m ago•0 comments

Didgeridoo playing as alternative treatment for obstructive sleep apnoea (2006)

https://pmc.ncbi.nlm.nih.gov/articles/PMC1360393/
210•kelseyfrog•2d ago•99 comments

Your Old Devices Depend on Dying Sensors. The Silicon Labs Incident Proves It

https://www.cambridge.org/engage/coe/article-details/6a054b304770e67d92e8c7a2
10•openrockets•2d ago•2 comments

Show HN: Audiomass – a free, open-source multitrack audio editor for the web

https://audiomass.co/?multitrack=1
431•pantelisk•23h ago•92 comments

AI errno(2) values

https://www.netmeister.org/blog/ai-errno.html
50•zdw•2d ago•11 comments

DeepSeek reasonix, DeepSeek native coding agent with high caching and low cost

https://esengine.github.io/DeepSeek-Reasonix/
616•Alifatisk•1d ago•255 comments

Show HN: Geomatic – a command-driven geometry studio enabled with autodiff

https://www.tinyvolt.com/geomatic
38•nivter•6h ago•9 comments

The physicists who convinced Fermilab to send Brazil's emails

https://buttondown.com/blog/brazil-fermilab-email
13•maguay•4d ago•3 comments

Migrating from Go to Rust

https://corrode.dev/learn/migration-guides/go-to-rust/
357•jabits•19h ago•348 comments

Bytecode VMs in surprising places (2024)

https://dubroy.com/blog/bytecode-vms-in-surprising-places/
70•azhenley•3d ago•23 comments

White Rabbit – sub-nanosecond synchronization for large distributed systems

https://ohwr.org/projects/white-rabbit/
139•michaelsbradley•2d ago•30 comments

Notes about reading messages with the Python email packages

https://utcc.utoronto.ca/~cks/space/blog/python/EmailPackagesNotes
33•ankitg12•5d ago•1 comments

I spent 50 hours drawing a line graph

https://www.dougmacdowell.com/50-hours-to-draw-some-lines.html
583•dougdude3339•3d ago•96 comments

Jira Is Turing-Complete

https://seriot.ch/computation/jira.html
233•vinhnx•10h ago•105 comments

A fundamental principle of aeronautical engineering has been overturned

https://www.wired.com/story/a-fundamental-principle-of-aeronautical-engineering-has-been-overturned/
195•littlexsparkee•19h ago•98 comments

Pope Leo: opaque AI run by few firms risks "New Forms of Dehumanization"

https://variety.com/2026/biz/global/pope-leo-ai-encyclical-algorithms-threaten-dehumanisation-123...
14•embedding-shape•1h ago•2 comments

Bug 1950764: Work Around Crash on Intel Raptor Lake CPU

https://phabricator.services.mozilla.com/D301917
131•luu•2d ago•43 comments

Microsoft pulls plug on plans for 244-acre data center in Caledonia

https://www.tmj4.com/news/racine-county/microsoft-pulls-plug-on-plans-for-244-acre-data-center-in...
9•cdrnsf•1h ago•0 comments

Rising seas will swallow New Orleans. People need to start relocating now

https://www.cnn.com/2026/05/25/climate/new-orleans-sea-level-rise-relocation
61•breve•4h ago•57 comments

Microsoft open-sources “the earliest DOS source code discovered to date”

https://arstechnica.com/gadgets/2026/04/microsoft-open-sources-the-earliest-dos-source-code-disco...
487•DamnInteresting•1d ago•177 comments

I love my Bluetooth keyboard

https://liquidbrain.net/blog/i-love-my-bluetooth-keyboard/
124•evakhoury•2d ago•124 comments

Defeating Git Rigour Fatigue with Jujutsu

https://ikesau.co/blog/defeating-git-rigour-fatigue-with-jujutsu/
153•ikesau•19h ago•150 comments

Building Pi with Pi

https://lucumr.pocoo.org/2026/5/24/pi-oss/
134•mplanchard•21h ago•115 comments