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.

Anatomy of the .claude/ Folder

https://blog.dailydoseofds.com/p/anatomy-of-the-claude-folder
122•freedomben•2h ago•70 comments

Installing a Let's Encrypt TLS Certificate on a Brother Printer with Certbot

https://owltec.ca/Other/Installing+a+Let%27s+Encrypt+TLS+certificate+on+a+Brother+printer+automat...
70•8organicbits•2h ago•19 comments

Desk for people who work at home with a cat

https://soranews24.com/2026/03/27/japan-now-has-a-special-desk-for-people-who-work-at-home-with-a...
65•zdw•1h ago•32 comments

The Last Gasps of the Rent Seeking Class

https://geohot.github.io//blog/jekyll/update/2026/02/26/the-last-gasps-of-the-rent-seeking-class....
32•surprisetalk•2h ago•17 comments

The 'paperwork flood': How I drowned a bureaucrat before dinner

https://sightlessscribbles.com/posts/the-paperwork-flood/
384•robin_reala•3h ago•301 comments

How and why to take a logarithm of an image [video]

https://www.youtube.com/watch?v=ldxFjLJ3rVY
116•jgwil2•4d ago•43 comments

A Faster Alternative to Jq

https://micahkepe.com/blog/jsongrep/
291•pistolario•9h ago•183 comments

Hold on to Your Hardware

https://xn--gckvb8fzb.com/hold-on-to-your-hardware/
412•LucidLynx•6h ago•342 comments

EMachines never obsolete PCs: More than a meme

https://dfarq.homeip.net/emachines-never-obsolete-pcs-more-than-a-meme/
21•zdw•3d ago•9 comments

Schedule tasks on the web

https://code.claude.com/docs/en/web-scheduled-tasks
237•iBelieve•11h ago•203 comments

Apple discontinues the Mac Pro

https://9to5mac.com/2026/03/26/apple-discontinues-the-mac-pro/
566•bentocorp•19h ago•520 comments

Gzip decompression in 250 lines of Rust

https://iev.ee/blog/gzip-decompression-in-250-lines-of-rust/
48•vismit2000•3d ago•20 comments

Apple says no one using Lockdown Mode has been hacked with spyware

https://techcrunch.com/2026/03/27/apple-says-no-one-using-lockdown-mode-has-been-hacked-with-spyw...
23•jbegley•34m ago•5 comments

Sand from Different Beaches in the World

https://magnifiedsand.com/
10•RAAx707•3d ago•1 comments

Why so many control rooms were seafoam green (2025)

https://bethmathews.substack.com/p/why-so-many-control-rooms-were-seafoam
952•Amorymeltzer•2d ago•196 comments

The European AllSky7 fireball network

https://www.allsky7.net/#archive
102•marklit•9h ago•7 comments

People inside Microsoft are fighting to drop mandatory Microsoft Account

https://www.windowscentral.com/microsoft/windows-11/people-inside-microsoft-are-fighting-to-drop-...
104•breve•2h ago•84 comments

Local Bernstein theory, and lower bounds for Lebesgue constants

https://terrytao.wordpress.com/2026/03/23/local-bernstein-theory-and-lower-bounds-for-lebesgue-co...
37•jjgreen•3d ago•7 comments

$500 GPU outperforms Claude Sonnet on coding benchmarks

https://github.com/itigges22/ATLAS
427•yogthos•23h ago•232 comments

Show HN: I put an AI agent on a $7/month VPS with IRC as its transport layer

https://georgelarson.me/writing/2026-03-23-nullclaw-doorman/
304•j0rg3•18h ago•88 comments

Iran-linked hackers have breached FBI Director Kash Patel's personal emails

https://www.cnn.com/2026/03/27/politics/iran-linked-hackers-fbi-director-patel
7•vrganj•4m ago•0 comments

Hong Kong Police Can Now Demand Phone Passwords Under New Security Rules

https://www.gadgetreview.com/hong-kong-police-can-now-demand-phone-passwords-under-new-security-r...
102•vidyesh•2h ago•93 comments

Meow.camera

https://meow.camera/#4258783365322591678
4•surprisetalk•2h ago•0 comments

We rewrote JSONata with AI in a day, saved $500k/year

https://www.reco.ai/blog/we-rewrote-jsonata-with-ai
242•cjlm•18h ago•223 comments

DOOM Over DNS

https://github.com/resumex/doom-over-dns
331•Venn1•4d ago•87 comments

Rank the 50 best Apple products

https://www.theverge.com/cs/tech/900477/apple-50-anniversary-rank-products
32•dqieu•2h ago•28 comments

Running Tesla Model 3's computer on my desk using parts from crashed cars

https://bugs.xdavidhu.me/tesla/2026/03/23/running-tesla-model-3s-computer-on-my-desk-using-parts-...
927•driesdep•1d ago•320 comments

QRV Operating System: QNX on RISC-V

https://r-tty.blogspot.com/2026/03/qrv-operating-system-first-publication.html
41•chrsw•4d ago•7 comments

My minute-by-minute response to the LiteLLM malware attack

https://futuresearch.ai/blog/litellm-attack-transcript/
414•Fibonar•1d ago•153 comments

Whistler: Live eBPF Programming from the Common Lisp REPL

https://atgreen.github.io/repl-yell/posts/whistler/
123•varjag•3d ago•15 comments