Top 10 SQL Errors
How to Fix PostgreSQL "relation does not exist"
PostgreSQL cannot find the table or view name in your query.
Example error message
ERROR: relation "users" does not exist
Common causes
- The table name is misspelled.
- The table is in another schema.
- The table was created with quoted uppercase letters.
- You are connected to the wrong database.
Quick fix
SELECT * FROM public.users;
Checklist
- Check spelling of table and column names.
- Check the correct database, schema, and table alias.
- Compare your SQL dialect: MySQL, PostgreSQL, SQL Server, Oracle, or SQLite.
- Run a very small SELECT query first, then add conditions step by step.