Unblock a database migration without terminating the wrong work.

Instruction: Recommend immediate containment and the evidence needed for any session cancellation.

Context:

A fictional PostgreSQL migration waits for an exclusive table lock. New application queries queue behind it. A long-running transaction started 25 minutes ago and holds a conflicting lock. You do not yet know whether that transaction is an approved financial batch. The migration has not changed the table.

Updated

Official answer available

Read the opening below, then unlock the full answer and practical guidance.

I would first stop the waiting migration through the approved cancellation path and verify that the application queue recovers...

Related Questions