Skip to content

Instantly share code, notes, and snippets.

@tgroshon
Created April 7, 2017 04:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tgroshon/c1b6335d8129179efe2da6f017a7562c to your computer and use it in GitHub Desktop.
Save tgroshon/c1b6335d8129179efe2da6f017a7562c to your computer and use it in GitHub Desktop.
Why does this cause a bunch of "SELECT * from my_table" queries to wait? How to make not locking?
BEGIN;
ALTER TABLE "my_table" ADD COLUMN "some_field" text NULL;
ALTER TABLE "my_table" ALTER COLUMN "some_field" DROP DEFAULT;
COMMIT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment