0

So I have this big database in production having partitions on date field. I ran this migration to add a new column and its now 1-hour db is stuck not responding and still migrating.

ALTER TABLE public.ur_sms_traffic ADD COLUMN trace_id varchar(16);

The table has no relation. just stand-alone table,

asked Dec 15, 2021 at 8:41
1
  • 1
    Most likely it's waiting to acquire the needed exclusive lock. Check pg_stat_activity and pg_locks Commented Dec 15, 2021 at 9:19

1 Answer 1

0

I found the issue by checking pg_stat_activity: someone ran a very big query in production and it was holding the migration.

mustaccio
28.7k24 gold badges60 silver badges77 bronze badges
answered Dec 15, 2021 at 13:36

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.