* 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
11–16 of 16 posts
* 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
Earlier quoted context omitted.
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) y…
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?
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.
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
Earlier quoted context omitted.
> 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...
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 CONCU…