Skip to content

Instantly share code, notes, and snippets.

@skeptrunedev
Last active June 2, 2024 17:39
Show Gist options
  • Save skeptrunedev/b1f09cbed0a2766953fde6b5a532e8c3 to your computer and use it in GitHub Desktop.
Save skeptrunedev/b1f09cbed0a2766953fde6b5a532e8c3 to your computer and use it in GitHub Desktop.
postgres-migration-status-and-kill.sql
-- the output of this command will have a table with a pid colummn
-- find the migration you want to stop and copy it's pid for step 2
SELECT *
FROM pg_stat_activity
WHERE state = 'active';
-- use the pid you copied from the previous output here instead of 7844
SELECT pg_cancel_backend(7844);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment