frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Pglocks.org

https://pglocks.org/
80•hnasr•10mo ago

Comments

whilenot-dev•10mo 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•10mo 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•10mo 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•10mo 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•10mo 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•10mo ago
I agree, it is not so straightforward to find out.
braiamp•10mo 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•10mo 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•10mo 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•10mo 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•10mo 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•10mo ago
Very practical! Locking is one of the things that can really bite when doing migrations.

Artemis II crew take 'spectacular' image of Earth

https://www.bbc.com/news/articles/ce8jzr423p9o
208•andsoitis•2h ago•104 comments

iNaturalist

https://www.inaturalist.org/
272•bookofjoe•4h ago•78 comments

What changes when you turn a Linux box into a router

https://patrickmccanna.net/7-configuration-changes-that-turn-a-multi-homed-host-into-a-switch-rou...
39•0o_MrPatrick_o0•3d ago•3 comments

Show HN: I built a frontpage for personal blogs

https://text.blogosphere.app/
589•ramkarthikk•9h ago•164 comments

How to Make a Sliding, Self-Locking, and Predator-Proof Chicken Coop Door (2020)

https://www.backyardchickens.com/articles/how-to-make-a-sliding-self-locking-and-predator-proof-c...
47•uticus•3h ago•16 comments

Oracle Files H-1B Visa Petitions Amid Mass Layoffs

https://nationaltoday.com/us/tx/austin/news/2026/04/03/oracle-files-thousands-of-h-1b-visa-petiti...
157•kklisura•1h ago•78 comments

Charge Robotics (YC S21) Is Hiring Software and Hardware Engineers

https://jobs.ashbyhq.com/charge-robotics
1•banks_h•33m ago

We replaced RAG with a virtual filesystem for our AI documentation assistant

https://www.mintlify.com/blog/how-we-built-a-virtual-filesystem-for-our-assistant
163•denssumesh•1d ago•85 comments

Go on Embedded Systems and WebAssembly

https://tinygo.org/
97•uticus•4h ago•13 comments

Samsung Magician disk utility takes 18 steps and two reboots to uninstall

https://chalmovsky.com/2026/03/29/samsung-magician.html
365•chalmovsky•5d ago•204 comments

Automatic Textbook Formalization

https://github.com/facebookresearch/repoprover
15•tzury•1h ago•4 comments

Async Python Is Secretly Deterministic

https://www.dbos.dev/blog/async-python-is-secretly-deterministic
38•KraftyOne•2h ago•21 comments

F-15E jet shot down over Iran

https://www.theguardian.com/world/2026/apr/03/us-fighter-jet-confirmed-shot-down-over-iran
250•tjwds•5h ago•598 comments

Build your own Dial-up ISP with a Raspberry Pi

https://www.jeffgeerling.com/blog/2026/build-your-own-dial-up-isp-with-a-raspberry-pi/
76•arjunbajaj•6h ago•17 comments

April 2026 TLDR Setup for Ollama and Gemma 4 26B on a Mac mini

https://gist.github.com/greenstevester/fc49b4e60a4fef9effc79066c1033ae5
275•greenstevester•12h ago•107 comments

Show HN: TurboQuant for vector search – 2-4 bit compression

https://github.com/RyanCodrai/py-turboquant
78•justsomeguy1996•5d ago•5 comments

Show HN: Ismcpdead.com – Live dashboard tracking MCP adoption and sentiment

https://ismcpdead.com
12•sagirodin•2h ago•6 comments

DCJ11Hack+ – DEC PDP/11 based homebrew computer

https://codeberg.org/TechPaula/DCJ11HackPlus
5•zdw•3d ago•0 comments

SSH certificates: the better SSH experience

https://jpmens.net/2026/04/03/ssh-certificates-the-better-ssh-experience/
184•jandeboevrie•12h ago•76 comments

Firm boosts H.264 streaming license fees from $100k up to staggering $4.5M

https://www.tomshardware.com/service-providers/streaming/h264-streaming-license-fees-jump-from-10...
94•MaximilianEmel•3h ago•48 comments

Update on the eBay Scam

https://kevquirk.com/update-on-the-ebay-scam
21•speckx•3h ago•26 comments

A Recipe for Steganogravy

https://theo.lol/python/ai/steganography/seo/recipes/2026/03/27/a-recipe-for-steganogravy.html
125•tbrockman•5d ago•29 comments

What Category Theory Teaches Us About DataFrames

https://mchav.github.io/what-category-theory-teaches-us-about-dataframes/
166•mchav•5d ago•53 comments

ESP32-S31: Dual-Core RISC-V SoC with Wi-Fi 6, Bluetooth 5.4, and Advanced HMI

https://www.espressif.com/en/news/ESP32_S31_Release
187•topspin•5d ago•105 comments

Show HN: Apfel – The free AI already on your Mac

https://apfel.franzai.com
621•franze•12h ago•136 comments

Iran Strikes Leave Amazon Availability Zones "Hard Down" in Bahrain and Dubai

https://www.bigtechnology.com/p/iran-strikes-leave-amazon-availability
13•upofadown•28m ago•2 comments

You can now run a full Linux operating system inside a 6mb PDF

https://twitter.com/oliviscusAI/status/2038563166431346865
62•matthewsinclair•3d ago•14 comments

Big-Endian Testing with QEMU

https://www.hanshq.net/big-endian-qemu.html
77•jandeboevrie•8h ago•71 comments

PIGuard: Prompt Injection Guardrail via Mitigating Overdefense for Free

https://injecguard.github.io/
6•mettamage•2h ago•2 comments

Category Theory Illustrated – Types

https://abuseofnotation.github.io/category-theory-illustrated/06_type/
80•boris_m•12h ago•13 comments