# Postgres error 55P03: could not obtain lock on row in relation "x"

> A lock was not available and the statement was told not to wait (NOWAIT) or hit lock_timeout.

Source: https://scribase.com/postgres-errors/55p03

SQLSTATE class: Object Not In Prerequisite State. Over PostgREST/supabase-js this maps to HTTP 500.

## Causes

- SELECT ... FOR UPDATE NOWAIT on a row another transaction holds.
- A migration with lock_timeout set, blocked by a long-running query.

## Fixes

- Retry later, or use SKIP LOCKED for worker queues so each worker takes different rows.
- For migrations, keep lock_timeout short and retry; find blockers with pg_blocking_pids(pid).

## Example

```sql
select id from jobs where status = 'queued'
order by id
for update skip locked
limit 10;
```