# Postgres error 42702: column reference "x" is ambiguous

> The same column name exists in more than one table in the query, or a PL/pgSQL variable has the same name as a column.

Source: https://scribase.com/postgres-errors/42702

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

## Causes

- A join where both tables have id or created_at, referenced without a table alias.
- A PL/pgSQL function parameter named like a column (user_id) used inside a query.

## Fixes

- Qualify columns with the table alias (o.id).
- Prefix function parameters (p_user_id) or qualify them with the function name.