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•12mo 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•12mo 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•12mo 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•12mo 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•12mo 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•12mo 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•12mo ago
Very practical! Locking is one of the things that can really bite when doing migrations.

GenCAD

https://gencad.github.io/
320•dagenix•12h ago•79 comments

Crystals found inside wreckage from the first nuclear bomb test

https://www.scientificamerican.com/article/strange-crystals-found-inside-wreckage-from-the-first-...
75•jumploops•2d ago•22 comments

It is time to give up the dualism introduced by the debate on consciousness

https://www.noemamag.com/there-is-no-hard-problem-of-consciousness/
82•ahalbert4•7h ago•212 comments

I turned a $80 RK3562 Android tablet into a Debian Linux workstation

https://github.com/tech4bot/rk3562deb
368•tech4bot•20h ago•171 comments

Ask an Astronaut: 333 hours of Q&A footage with astronauts

https://askanastronaut.issinrealtime.org/
148•gaws•2d ago•12 comments

Germany goes from labour shortages to hiring freezes

https://www.ft.com/content/2a6c1cb9-6c11-41c8-a8ea-a367b8799126
12•doener•53m ago•2 comments

Jank now has its own custom IR

https://jank-lang.org/blog/2026-05-08-optimization/
143•DASD•2d ago•20 comments

Show HN: Semble – Code search for agents that uses 98% fewer tokens than grep

https://github.com/MinishLab/semble
328•Bibabomas•18h ago•112 comments

Profunctor Equipment in Haskell

https://bartoszmilewski.com/2026/05/16/profunctor-equipment-in-haskell/
21•g0xA52A2A•1d ago•2 comments

WriteUp: 16 Bytes of x86 that turn Matrix rain into sound

https://hellmood.111mb.de//wake_up_16b_writeup.html
138•HellMood•10h ago•30 comments

Prolog Coding Horror

https://www.metalevel.at/prolog/horror
142•RohanAdwankar•12h ago•57 comments

kharp – k version 3 Language Interpreter in C#

https://github.com/ERufian/ksharp
21•tosh•1d ago•3 comments

A Good Lemma Is Worth a Thousand Theorems (2007)

https://sites.math.rutgers.edu/~zeilberg/Opinion82.html
61•susam•2d ago•12 comments

Magical Realism: “Northern Exposure” 25 Years Later (2015)

https://www.rogerebert.com/streaming/magical-realism-nothern-exposure-25-years-later
117•walterbell•2d ago•49 comments

Tesla Solar Roof is on life support as it pivot to panels

https://electrek.co/2026/05/14/tesla-solar-roof-promise-vs-reality-pivot-panels/
258•celsoazevedo•1d ago•266 comments

Two EA-18 fighter jets collide at Mountain Home airshow, pilots ejected safely

https://idahonews.com/news/local/two-f-18-fighter-jets-have-crashed-during-an-airshow-at-mountain...
194•ChrisArchitect•12h ago•194 comments

The SGI Buyer's Guide (2003)

https://hardware.majix.org/computers/sgi/buyers-guide.shtml
30•uticus•2d ago•11 comments

The 30-Hour Shift That Turned a San Jose Robot Lab into a Global Spectacle

https://beeble.com/en/blog/the-30-hour-shift-that-turned-a-san-jose-robot-lab-into-a-global-spect...
3•odysseyk•2d ago•1 comments

Build a Radio Wave Detector with Balls of Aluminum Foil

https://www.wired.com/story/build-a-radio-wave-detector-with-balls-of-aluminum-foil/
13•Brajeshwar•2d ago•3 comments

CUDA Books

https://github.com/alternbits/awesome-cuda-books
196•dariubs•21h ago•47 comments

Why is Google Maps back to showing old satellite images of Altadena?

https://www.reddit.com/r/pasadena/s/94BHlkE84r
18•tgrowazay•1h ago•5 comments

Hindenburg’s Smoking Room

https://www.airships.net/hindenburg-smoking-room/
202•crescit_eundo•3d ago•161 comments

Prolog Basics Explained with Pokémon

https://unplannedobsolescence.com/blog/prolog-basics-pokemon/
255•birdculture•2d ago•41 comments

I don't think AI will make your processes go faster

https://frederickvanbrabant.com/blog/2026-05-15-i-dont-think-ai-will-make-your-processes-go-faster/
594•TheEdonian•21h ago•406 comments

Show HN: Mezz, a curl-able WiFi sandbox for IoT pentesting

https://github.com/ABGEO/mezz
21•ABGEO•2d ago•6 comments

High-Entropy Alloy

https://en.wikipedia.org/wiki/High-entropy_alloy
136•leonidasrup•3d ago•23 comments

Cannibalistic attacks between gray seals leave telltale “corkscrew” injuries

https://www.science.org/content/article/scientists-id-corkscrew-killer-behind-gruesome-seal-deaths
65•gmays•3d ago•26 comments

Trials on veterans suggest ibogaine could provide a new treatment for PTSD

https://www.bbc.com/future/article/20260514-how-hallucinogenic-ibogaine-helps-veterans-overcome-ptsd
95•bushwart•21h ago•103 comments

Multiple commencement speakers booed for AI comments during graduation speeches

https://www.nbcnews.com/video/multiple-commencement-speakers-booed-for-ai-comments-during-graduat...
3•wrxd•48m ago•0 comments

A nicer voltmeter clock

https://lcamtuf.substack.com/p/a-nicer-voltmeter-clock
345•surprisetalk•1d ago•45 comments