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,
1 Answer 1
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
lang-sql
pg_stat_activity
andpg_locks