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.

GLM-5.4: Toward Generalized Coding with Our First Loop Transformer

https://z.ai/blog/glm-5.4
534•foohis•5h ago•209 comments

Jensen Huang Reinstated as Nvidia CEO

https://nvidianews.nvidia.com/news/nvidia-board-reinstates-jensen-huang-as-president-ceo-and-boar...
1051•alanwong•1h ago•818 comments

Win4wine – Run Windows Shell as the Linux Desktop on Wine

https://github.com/mikuta0407/win4wine
56•hard_times•2h ago•24 comments

The next circle of security hell

https://blogs.gentoo.org/mgorny/2026/10/27/the-next-circle-of-security-hell/
100•qtqtqt•3h ago•44 comments

Nospeaker ─ Make your MacBook's trackpad talk using its haptic motor

https://github.com/os6/nospeaker
72•yakkomajuri•3h ago•26 comments

Free alternative TV network built from the Internet Archive's forgotten videos

https://spelunkr.tv
709•SockThief•13h ago•134 comments

XNU Linux: Full OS X GUI Userspace on Linux

https://github.com/AFK-surf/xnulinux
469•mmastrac•11h ago•201 comments

What's the difference between an integer and a pointer?

https://blog.regehr.org/archives/1621
19•germanrabbit•2d ago•2 comments

MRAM Basics: How Magnetic Memory Is Replacing Embedded Flash

https://www.allaboutcircuits.com/technical-articles/mram-basics-how-magnetic-memory-is-replacing-...
42•giuliomagnifico•2d ago•14 comments

Elixir HLS makes FPGA circuits from functions written in Elixir

https://github.com/elixir-hls/elixir-hls
93•kristianpaul•2d ago•3 comments

A Beginner's Guide to Local AI with Inkling, Qwen, and Unsloth

https://www.gpupartner.com/blog/beginners-guide-local-ai-inkling-qwen-unsloth
632•Retell15•18h ago•261 comments

Yes, 17M lines of Lean is a lot

https://micjm.com/blog/yes-17m-lines-of-lean-is-a-lot/
186•seizethecheese•10h ago•225 comments

Reviving the Donkey Car with Erlang

https://underjord.io/reviving-the-donkey-car-with-erlang.html
13•lawik•2d ago•0 comments

The Birds of GTA 6: A Field Guide to Vice City and Leonida's Wildlife

https://www.audubon.org/magazine/birds-of-gta-6-field-guide-vice-city-wildlife
579•gaws•19h ago•317 comments

Perplexity and Intelligence

https://openai.com/index/perplexity-and-intelligence/
640•acossta•22h ago•417 comments

Cathedral floor emerges in Sudan, revealing one of the biggest medieval churches

https://apnews.com/article/sudan-antiquities-nubia-cathedral-1b16f67da881ee5592de4481ee55c527
306•graemep•4d ago•107 comments

Masullo on the Riemann Hypothesis

https://johncarlosbaez.wordpress.com/2026/11/22/masullo-on-the-riemann-hypothesis/
267•xiaoyu2006•1d ago•255 comments

Brake Check: Hijacking Trailer Brakes over Bluetooth

https://elementdigital.com.au/blog/brake-check-trailer-brakes-over-bluetooth/
55•DeepLogin•2d ago•41 comments

Assume People Are Not Interested in Your Blog Post

https://danielsada.tech/blog/assume-people-are-not-interested-in-your-blog-post/
262•dshacker•19h ago•133 comments

A Partial Evaluator for C

https://phoenix.labri.fr/software/tempo/
86•measurablefunc•10h ago•22 comments

Treemap of the Riemann Hypothesis Lean Proof

https://pengowray.github.io/riemann-zeta-proof-visualizer/
138•pengowray•13h ago•57 comments

CollectWise (YC F24) Is Hiring

https://www.ycombinator.com/companies/collectwise/jobs/lgobCse-founding-customer-success-manager
1•OBrien_1107•8h ago

GL.iNet Security Notice 2026-11-20

https://www.gl-inet.com/en-us/blogs/blog/glinet-security-notice-2026-11-20
236•gregsadetsky•16h ago•112 comments

A miniature San Francisco with live buses, planes and boats

https://smallsf.com/
317•dutilh•18h ago•104 comments

The struggle for freedom: How BSD escaped AT&T licensing

https://fosscomics.com/posts/16.%20BSD%20Unix%20Part%206%20-%20The%20Struggle%20for%20Freedom/
144•joonehur•17h ago•60 comments

The New Docker: Built to Run on Trust

https://www.docker.com/blog/meet-the-new-docker-built-to-run-on-trust/
74•peer2pay•11h ago•148 comments

The Quartz Page

http://www.quartzpage.de/index.html
18•AdamH12113•3d ago•4 comments

The Usefulness of Useless Knowledge [pdf] (1939)

https://www.ias.edu/sites/default/files/library/UsefulnessHarpers.pdf
155•hectormauer•16h ago•35 comments

Nyx, the Oldest Internet Service Provider

https://nyx.net/
151•o_-_o•18h ago•27 comments

Show HN: I built a game where you are an LLM's subagent

https://github.com/gulivan/worker755
345•ivantgam•1d ago•83 comments