# Postgres error 42P07: relation "x" already exists

> A CREATE statement names a table, index, view or sequence that is already there.

Source: https://scribase.com/postgres-errors/42p07

SQLSTATE class: Syntax Error or Access Rule Violation. Over PostgREST/supabase-js this maps to HTTP 400.

## Causes

- Running the same migration twice.
- An index name reused across tables (index names are unique per schema, not per table).

## Fixes

- Use create table if not exists / create index if not exists in idempotent scripts.
- Track applied migrations with a migrations table or tool, so each runs once.