From: https://stackoverflow.com/questions/26596566/postgres-database-locked-queries-running-forever
You should check for locks:
SELECT l.*,a.*
FROM pg_locks l
JOIN pg_stat_activity a USING (pid)
WHERE NOT granted;
From: https://stackoverflow.com/questions/26596566/postgres-database-locked-queries-running-forever
You should check for locks:
SELECT l.*,a.*
FROM pg_locks l
JOIN pg_stat_activity a USING (pid)
WHERE NOT granted;
I have moved this over to the Tech Interview Cheat Sheet Repo and has been expanded and even has code challenges you can run and practice against!
\