frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Pglocks.org

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

Comments

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

Halt and Catch Fire: TV's Best Drama You've Probably Never Heard Of (2021)

https://www.sceneandheardnu.com/content/halt-and-catch-fire
231•walterbell•3h ago•146 comments

Claude Sonnet 4.6

https://www.anthropic.com/news/claude-sonnet-4-6
991•adocomplete•11h ago•880 comments

Thank HN: You helped save 33k lives

619•chaseadam17•12h ago•72 comments

BarraCUDA Open-source CUDA compiler targeting AMD GPUs

https://github.com/Zaneham/BarraCUDA
223•rurban•9h ago•77 comments

Thousands of CEOs just admitted AI had no impact on employment or productivity

https://fortune.com/2026/02/17/ai-productivity-paradox-ceo-study-robert-solow-information-technol...
278•virgildotcodes•4h ago•185 comments

Show HN: AsteroidOS 2.0 – Nobody asked, we shipped anyway

https://asteroidos.org/news/2-0-release/index.html
317•moWerk•10h ago•36 comments

Minimal x86 Kernel Zig

https://github.com/lopespm/zig-minimal-kernel-x86
65•lopespm•5h ago•18 comments

Gentoo on Codeberg

https://www.gentoo.org/news/2026/02/16/codeberg.html
293•todsacerdoti•12h ago•105 comments

Using go fix to modernize Go code

https://go.dev/blog/gofix
308•todsacerdoti•13h ago•67 comments

Reverse Engineering Sid Meier's Railroad Tycoon for DOS from 1990

https://www.vogons.org/viewtopic.php?t=105451
51•LowLevelMahn•3d ago•7 comments

So you want to build a tunnel

https://practical.engineering/blog/2026/2/17/so-you-want-to-build-a-tunnel
193•crescit_eundo•12h ago•80 comments

The Economics of a Super Bowl Ad

https://ro.co/perspectives/super-bowl-economics/
8•nnmg•2d ago•9 comments

Async/Await on the GPU

https://www.vectorware.com/blog/async-await-on-gpu/
174•Philpax•12h ago•51 comments

Google Public CA is down

https://status.pki.goog/incidents/5oJEbcU3ZfMfySTSXXd3
216•aloknnikhil•4h ago•117 comments

Is Show HN dead? No, but it's drowning

https://www.arthurcnops.blog/death-of-show-hn/
451•acnops•19h ago•376 comments

I swear the UFO is coming any minute

https://www.experimental-history.com/p/i-swear-the-ufo-is-coming-any-minute
130•Ariarule•7h ago•45 comments

Tesla Sales Down 55% UK, 58% Spain, 59% Germany, 81% Netherlands, 93% Norway

https://cleantechnica.com/2026/02/15/tesla-sales-down-tremendously-in-uk-norway-netherlands-germa...
155•whynotmaybe•14h ago•87 comments

I Use Obsidian (2023)

https://stephango.com/vault
55•hisamafahri•7h ago•34 comments

Show HN: I wrote a technical history book on Lisp

https://berksoft.ca/gol/
185•cdegroot•14h ago•68 comments

Quamina and Claude, Case 1

https://www.tbray.org/ongoing/When/202x/2026/02/06/Q-Plus-C-Ch1
3•zdw•3d ago•0 comments

Structured AI (YC F25) Is Hiring

https://www.ycombinator.com/companies/structured-ai/jobs/q3cx77y-gtm-intern
1•issygreenslade•8h ago

Use Microsoft Office Shortcuts in Libre Office

https://github.com/Zaki101Aslam/MS-office-shortcuts-for-Libre-Office
32•Zaki101Aslam•2d ago•8 comments

I converted 2D conventional flight tracking into 3D

https://aeris.edbn.me/?city=SFO
235•kewonit•15h ago•48 comments

'My Words Are Like an Uncontrollable Dog': On Life with Nonfluent Aphasia (2025)

https://thereader.mitpress.mit.edu/my-words-are-like-an-uncontrollable-dog-on-life-with-nonfluent...
40•anarbadalov•6h ago•8 comments

Assistant to the Regional Manager

https://smallpotatoes.paulbloom.net/p/assistant-to-the-regional-manager
84•NaOH•4d ago•32 comments

Physicists Make Electrons Flow Like Water

https://www.quantamagazine.org/physicists-make-electrons-flow-like-water-20260211/
89•rbanffy•4d ago•10 comments

HackMyClaw

https://hackmyclaw.com/
284•hentrep•12h ago•144 comments

Show HN: Pg-typesafe – Strongly typed queries for PostgreSQL and TypeScript

https://github.com/n-e/pg-typesafe
55•n_e•11h ago•21 comments

It's not just you, YouTube is partially down in outage

https://9to5google.com/2026/02/17/youtube-outage-february-2026/
47•aqeelat•3h ago•4 comments

Create bootable ISO image files which are compatible with the Amiga CD32

https://github.com/fuseoppl/isocd-win
15•doener•6h ago•1 comments