frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

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.

Shipping a laptop to a refugee camp in Uganda

https://notesbylex.com/shipping-a-laptop-to-a-refugee-camp-in-uganda
268•lexandstuff•6h ago•81 comments

Why Japanese companies do so many different things

https://davidoks.blog/p/why-japanese-companies-do-so-many
555•d0ks•13h ago•290 comments

Project Glasswing: An Initial Update

https://www.anthropic.com/research/glasswing-initial-update
357•louiereederson•8h ago•223 comments

Neutron scattering explains why gluten-free pasta falls apart (2025)

https://phys.org/news/2025-09-science-spaghetti-neutron-gluten-free.html
27•layer8•2d ago•6 comments

Microsoft reports AI is more expensive than paying human employees

https://fortune.com/2026/05/22/microsoft-ai-cost-problem-tokens-agents/
32•nreece•39m ago•6 comments

Sleep research led to a new sleep apnea drug

https://temertymedicine.utoronto.ca/news/how-decades-sleep-research-led-new-sleep-apnea-drug
99•colinprince•6h ago•64 comments

Blood Pumping Mechanism of the Hoof

https://horses.extension.org/blood-pumping-mechanism-of-the-hoof/
48•thunderbong•2d ago•3 comments

Open source Kanban desktop app that runs parallel agents on every card

https://www.kanbots.dev/
189•vitriapp•10h ago•107 comments

CISA tries to contain data leak

https://krebsonsecurity.com/2026/05/lawmakers-demand-answers-as-cisa-tries-to-contain-data-leak/
156•speckx•11h ago•44 comments

Comparing an LZ4 Decompressor on Four Legacy CPUs

https://bumbershootsoft.wordpress.com/2026/05/09/comparing-an-lz4-decompressor-on-four-legacy-cpus/
43•tosh•2d ago•1 comments

A Wayland Compositor in Minecraft

https://modrinth.com/mod/waylandcraft
160•Jotalea•2d ago•30 comments

"Stick" – A primitive/fun interactive demo of a tiny rig to animate layout

https://cosmiciron.github.io/layoutmaster/exclusion-assembly.html
16•zhxiaoliang•2d ago•1 comments

SpaceX launches Starship v3 rocket

https://www.nbcnews.com/now/video/spacex-successfully-launches-prototype-of-starship-rocket-26383...
207•busymom0•4h ago•108 comments

Deno 2.8

https://deno.com/blog/v2.8
329•roflcopter69•17h ago•144 comments

FBI director's Based Apparel site has been spotted hosting a 'ClickFix' attack

https://www.pcmag.com/news/kash-patels-apparel-site-is-trying-to-trick-visitors-into-installing-m...
89•bilalq•3h ago•26 comments

Antigravity 2.0 Tops the OpenSCAD Architectural 3D LLM Benchmark

https://modelrift.com/blog/openscad-llm-benchmark/
364•jetter•17h ago•144 comments

Wi-Wi is wireless time sync at 1 nanosecond

https://www.jeffgeerling.com/blog/2026/wi-wi-is-wireless-time-sync-less-than-5ns/
101•Brajeshwar•2d ago•18 comments

1940 Air Terminal Museum Begins Liquidation

https://www.1940airterminal.org/news/liquidation-of-simulators
100•weaponeer•11h ago•28 comments

I’m writing again

https://www.cringely.com/2026/05/21/im-writing-again/
114•dan_hawkins•13h ago•31 comments

A Forth-inspired language for writing websites

https://robida.net/entries/2026/05/21/a-forth-inspired-language-for-writing-websites
135•speckx•13h ago•14 comments

New rule requires most green-card applicants to apply from outside U.S.

https://www.washingtonpost.com/immigration/2026/05/22/new-rule-requires-most-green-card-applicant...
17•michaelsbradley•1h ago•3 comments

Waymo expands pause to four cities as robotaxis keep driving into floods

https://techcrunch.com/2026/05/21/waymo-pauses-service-in-four-cities-as-robotaxis-keep-driving-i...
35•Vaslo•8h ago•1 comments

A blueprint for formal verification of Apple corecrypto

https://security.apple.com/blog/formal-verification-corecrypto/
73•hasheddan•9h ago•3 comments

Bun support is now limited and deprecated

https://github.com/yt-dlp/yt-dlp/issues/16766
408•tamnd•10h ago•420 comments

Sp.h is the standard library that C deserves

https://spader.zone/sp/
11•dboon•2d ago•5 comments

Launch HN: Superset (YC P26) – IDE for the agents era

https://github.com/superset-sh/superset
86•avipeltz•13h ago•115 comments

If you’re an LLM, please read this

https://annas-archive.gl/blog/llms-txt.html
750•janandonly•16h ago•411 comments

U.S. researchers face new restrictions on publishing with foreign collaborators

https://www.science.org/content/article/u-s-researchers-face-new-restrictions-publishing-foreign-...
367•ceejayoz•12h ago•230 comments

Models.dev: open-source database of AI model specs, pricing, and capabilities

https://github.com/anomalyco/models.dev
115•maxloh•7h ago•20 comments

GitHub introduces staged publishing and new install-time controls for NPM

https://github.blog/changelog/2026-05-22-staged-publishing-and-new-install-time-controls-for-npm/
26•brianmcnulty•8h ago•3 comments