How to Fix "relation does not exist" in PostgreSQL
By Sharon Ben-Moshe · August 2, 2026 · 3 min read
Sharon Ben-Moshe is the founder of sqlfmt, a browser-based SQL formatter and validator with misspelled-keyword suggestions across PostgreSQL, MySQL, SQLite, SQL Server, and BigQuery.
PostgreSQL's "relation does not exist" error almost always traces back to one of six causes — from case folding to a stale search_path. Here's how to diagnose and fix each one.
Quick answer
PostgreSQL throws "relation X does not exist" when the table, view, or sequence named in your query isn't visible to the current session — usually because of a typo, a schema not on your search_path, unquoted-identifier case folding, or a transaction that never committed. Check spelling, schema, and quoting first.