Settings

Theme

Show HN: pglockanalyze - See the locks your Postgres migrations will acquire

github.com

8 points by pasxizeis 7 months ago · 0 comments · 1 min read

Reader

Hello! I created this tool to make reasoning about Postgres locks a bit easier.

Given a database[1] and a set of DDL statements/migrations you want to check, pglockanalyze will open a transaction, execute the statements, read the pg_locks view to analyze the locks they acquire and rollback (or commit, depending on the flags you passed) the transaction. Then, it will output the results for each statement.

I think there's merit in this idea, that said it's very much an experiment so there could be flaws and/or corner cases that this strategy won't work well for.

It's meant to act as a complement, not a replacement, to things like static analysis and the official Postgres docs.

Curious to see what others think; feedback is more than welcome!

https://github.com/agis/pglockanalyze

Thanks in advance

[1] typically an ephemeral database spawned by your CI pipeline

No comments yet.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection