Postgres Locks Explained: From Theory to Advanced Troubleshooting