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.

Kimi K3.1 Pro and K3.1 Pro Highspeed

https://www.kimi.ai/blog/kimi-k3-1-pro
411•Jowsey•2h ago•224 comments

Today, we hacked what we'd set out to hack: the iPhone

https://blog.calif.io/p/iphone
507•pavel_lishin•3h ago•327 comments

Apple Music 404 Not Found

https://music.apple.com/this-url-doesnt-exist
180•frizlab•7h ago•57 comments

Kimi K3.1 scores 55 on Artificial Analysis, placed on the Pareto line

https://artificialanalysis.ai/models/kimi-k3-1-pro
51•theanonymousone•1h ago•1 comments

UUIDv7 doesn't have the properties you think it does

https://alexsci.com/blog/uuidv7-is-weird/
64•ibobev•3h ago•41 comments

Local Wikipedia: Wikipedia, but only for things a half hour walk from you

https://edjefferson.com/localwiki/
1052•sohkamyung•20h ago•206 comments

The Real Kevin Bacon

https://pudding.cool/2026/10/kevin-bacon/
123•xnx•3d ago•39 comments

How Is Music Possible

https://www.henrikkarlsson.xyz/p/music
48•rafaelc•3h ago•32 comments

Canadians are running out of time to oppose Bill C-22

https://www.eff.org/deeplinks/2026/10/canadians-are-running-out-time-oppose-dangerous-c-22-survei...
160•hn_acker•20h ago•59 comments

The Missed Opportunities of Sonic 06

https://isaacmarovitz.com/posts/sonic-06/
44•ibobev•3h ago•3 comments

I turned my TV into a Game Boy Color with a Pokemon town as my home screen

https://twitter.com/robbietilton/status/2111936458923851923
29•scrambled•2h ago•8 comments

Air Purifiers as White Noise Machines

https://www.jefftk.com/p/air-purifiers-as-white-noise-machines
20•luu•2h ago•22 comments

Docker is weird

https://codeandcake.dev/posts/2026-10-22-docker-is-weird
795•psxuaw•19h ago•328 comments

Show HN: Impossible Machines: declaratively program the physical world

https://www.impossiblemachines.xyz
36•bhaprayan•19h ago•7 comments

Time Nuts (2005)

http://leapsecond.com/time-nuts.htm
22•jacquesm•2h ago•16 comments

Total Historian

https://www.theideasletter.org/essay/total-historian/
16•benbreen•3h ago•3 comments

Reforming English Spelling

https://blog.oup.com/2026/10/reforming-english-spelling/
5•jruohonen•3h ago•4 comments

LISP Comes of Age (1980)

https://microship.com/lisp-comes-of-age/
37•so-cal-schemer•1d ago•14 comments

Show HN: Swurf – Swipe through the real web

https://swurf.org/
24•webtjb096•12h ago•7 comments

Animations for System Builders

https://brooker.co.za/blog/2026/10/23/animations.html
12•KraftyOne•2h ago•1 comments

Can we replace a $150k Looker with a bucket of HTML files?

https://david.lequin.dev/blog/bi-software-is-dead/
54•skadamat•2h ago•34 comments

Ask HN: If the models are so good, why doesn't OpenAI just start 100 companies?

501•ex-aws-dude•22h ago•552 comments

Gemma-4-26B-A4B with 39-69% less thinking at same accuracy

https://bottlecapai.com/post/thinkingcap-gemma-4-26b/
65•armcat•4h ago•8 comments

The foolishness of "natural language programming" (1978)

https://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD667.html
339•xiaoyu2006•18h ago•230 comments

Job loss and cortisone mania

https://tilschuenemann.de/job-loss-cortisone-mania
141•speckx•9h ago•75 comments

Show HN: OnKey – I'm a bad singer, so I built an app to show where I'm off-key

https://github.com/dsmurrell/onkey
181•dsmurrell•1d ago•77 comments

Show HN: Searching for optimal strategies in a puzzle game with chance (Drop7)

https://drop7.dev
8•primitivesuave•2h ago•0 comments

We have traits at home

https://www.axelmagn.com/blog/202610-zig-traits/
34•Ygg2•20h ago•9 comments

The alien space of science: Coherent but cognitively unavailable directions

https://arxiv.org/abs/2603.01092
186•martincsweiss•1d ago•72 comments

How does Fable 5.1 hide messages in images?

https://www.lesswrong.com/posts/WHEQps5PK8LrrcTAb/how-does-fable-5-1-hide-messages-in-images
185•gmays•21h ago•64 comments