PostgreSQL: ERROR: relation "x" does not exist

The table/view isn’t found — missing migration, wrong schema, or a case-sensitive quoted name.

Seen on: PostgreSQL

Meaning

PostgreSQL folds unquoted identifiers to lower case. A table created as "Users" (quoted) must always be queried as "Users". Also check search_path — the table may be in another schema.

Common causes

  • Migrations not run
  • Wrong database or schema (search_path)
  • Case-sensitive quoted table name
  • Table created in a transaction that was rolled back

⚡ Quick fix

  1. \dt *.* in psql to list tables across schemas
  2. Run migrations
  3. Use lower-case unquoted names, or quote consistently
  4. Set search_path or schema-qualify: app.users

Detailed fix by platform

PostgreSQL

  1. ORMs like Prisma/Sequelize may quote names — keep model names lower-case or configure table names explicitly.

How to diagnose

  1. Database — Connected to the right DB?
  2. Schema — search_path includes it?
  3. Case — Created with quotes?

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.