> ## Documentation Index
> Fetch the complete documentation index at: https://loadwise.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# migration-table-access-exclusive-lock

> LOCK TABLE takes an ACCESS EXCLUSIVE lock on an existing PostgreSQL table.

## What it flags

`LOCK TABLE` requests `ACCESS EXCLUSIVE` on an existing PostgreSQL table. Omitting the mode also requests this lock. Once acquired, it blocks reads and writes until the transaction releases it. [PostgreSQL LOCK documentation](https://www.postgresql.org/docs/17/sql-lock.html)

## How to review or fix

Check what the migration needs to protect. Use a weaker mode if it provides the required protection, or schedule the operation and minimize the work performed while holding the lock.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.