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.

September 2026: The world today, as seen by one Polish guy

https://tomwojcik.com/posts/2026-09-21/september-2026-the-world-today/
37•marjancek•1h ago•2 comments

Livenerf: Has Opus 5.5 been nerfed yet?

https://github.com/ninjahawk/livenerf
566•bryan0•9h ago•240 comments

Solving Factorio Quality

https://exyr.org/2026/solving-factorio-quality/
44•laurenth•1d ago•14 comments

Dots: Always-on agents

https://openai.com/index/introducing-dots/
584•alvis•15h ago•448 comments

U.S. postal inspectors shut down website selling counterfeit postage labels

https://postalemployeenetwork.com/news/2026/09/26/u-s-postal-inspectors-shut-down-website-selling...
221•ilamont•13h ago•131 comments

Vermont replacing power plants with home batteries

https://www.bbc.com/future/article/20260928-a-virtual-power-plant-hidden-in-vermont-homes-is-keep...
180•devonnull•14h ago•143 comments

NASA asked several former SR-71A staffers to help secret restart

https://aviationweek.com/defense/aircraft-propulsion/nasa-asked-several-former-sr-71a-staffers-he...
150•ilamont•22h ago•142 comments

Testing WebGPU data layouts with Facet

https://www.mattkeeter.com/blog/2026-08-23-wgpu-facet/
30•luu•1d ago•0 comments

RSS Feeds for Last.fm

https://lfm.xiffy.nl/
58•Baljhin•5h ago•12 comments

America.gov

https://america.gov/
539•plesiv•18h ago•448 comments

Raleigh Vektar Restoration (2020)

https://retromash.com/2020/06/26/raleigh-vektar-restoration-part-1-the-arrival/
6•robin_reala•1d ago•0 comments

Show HN: Real-time Solar System with 526k asteroids and all tracked satellites

https://space.bl2.net/
229•wanick•13h ago•49 comments

How Delhi cut electricity loss from 50 to 5 percent

https://spectrum.ieee.org/delhi-electricity-loss
511•rbanffy•19h ago•286 comments

GPT 6.1 Sol: Near-Astra intelligence for a fifth of the price

https://openai.com/index/introducing-gpt-6-1-sol/
914•crorella•15h ago•818 comments

Backblaze drive stats for Q2 2026

https://www.backblaze.com/blog/backblaze-drive-stats-for-q2-2026/
173•HieronymusBosch•18h ago•43 comments

Phyllotaxis: An audio-reactive LED display

https://jagi.studio/posts/phyllotaxis/
286•evakhoury•1d ago•47 comments

Needed 1+1, built a functional programming language

https://hereticpleb.vercel.app/blog/needed-one-plus-one/
88•birdculture•16h ago•26 comments

Language models for text classification: From bag-of-words to Jev

https://magazine.sebastianraschka.com/p/classifier-history-and-jev
103•Anon84•21h ago•4 comments

PS5 Relapse Exploit

https://github.com/ntfargo/Relapse-Exploit
300•therepanic•16h ago•177 comments

When oil prices spike, where does the money go?

https://theconversation.com/when-oil-prices-spike-where-does-the-money-go-280763
79•thelastgallon•1d ago•68 comments

Ask HN: What are you reading?

261•dan-bailey•18h ago•536 comments

NAND-16: a computer built from 277,248 NAND gates

https://somethingbig.ai/computer
138•rossant•2d ago•78 comments

A Staff Engineer's Guide to Inventing Work

https://sujithjay.com/inventing-work
260•amortize•1d ago•53 comments

PSSA: A non-transformer language model written from scratch in Rust

https://github.com/Sparticle62ops/pssa
76•sparticle62•5h ago•31 comments

NRC issues first U.S. construction permit for a BWRX-300 small modular reactor

https://www.gevernova.com/news/press-releases/nrc-issues-first-us-construction-permit-bwrx-300-sm...
34•papa-whisky•9h ago•5 comments

We’re forgetting what darkness feels like

https://www.theguardian.com/environment/2026/sep/29/night-sky-darkness-city-regulation
150•pseudolus•14h ago•77 comments

Show HN: NSL – WSL for Linux

https://frostyard.github.io/nsl/
127•bketelsen•17h ago•78 comments

Why Is Sam Altman a Free Man?

https://prospect.org/2026/09/29/artificial-intelligence-agents-openai-microsoft-sam-altman-greg-b...
11•ragall•58m ago•1 comments

Show HN: Using 2D DFT, dithering, etc. to maximize eInk manga image quality

https://github.com/ciromattia/kcc
15•seam_carver•1d ago•3 comments

Show HN: A working 3D model of an Enigma machine

https://enigma.design
66•primitivesuave•15h ago•23 comments