SQLStreams

the messaging platform that is just Postgres

You last visited on 9999-99-99 Show what's new since then
[SOLVED]

could not take a lock needed by the migration step [SQL0053]

Edit this page
code SQL0053 · recovery transient — an unchanged retry can succeed; retry machinery retries on its backoff schedule
the log line · Report this thread
SQL0053 Transient error

As it arrives in your log or error chain — the values are your call's own:

could not take a lock needed by the migration step -- end the blocking session (pg_stat_activity), then run the migration again [SQL0053]

Transactional migration steps run under a 2-second lock_timeout. A step whose DDL waits longer than that for a lock — another session holds a conflicting one — rolls back whole and retries on the backoff schedule. This error surfaces when the contention outlasts the schedule: something held the lock the entire time, usually a long-running query or a session idle in transaction.

ACCEPTED ANSWER Posted: 2026-09-09
brandon Site Admin brandon profile Posts: 677

end the blocking session (pg_stat_activity), then run the migration again

Nothing pasted yet — the queries above show their blanks.

Looking for a different code? Search every thread.