PostgreSQL: ERROR: column "x" does not exist
PostgreSQL can’t find the column — a missing migration, a case-sensitive quoted name, or a string literal written in double quotes.
column does not exist Meaning
Two PostgreSQL-specific traps cause most of these: unquoted identifiers are folded to lower case (a column created as "createdAt" must always be quoted), and double quotes mean *identifier*, not string — WHERE status = "paid" looks for a column named paid.
Common causes
- String value in double quotes (
"paid"instead of'paid') - Mixed-case column created with quotes, queried without (
createdAt→createdat) - Migration adding the column not run
- Column alias used in WHERE (aliases only exist in ORDER BY/outer query)
⚡ Quick fix
- Use single quotes for strings
- Quote mixed-case names exactly (
"createdAt") — or rename columns to snake_case - Run pending migrations
- Move alias-based filters into a subquery or repeat the expression
Detailed fix by platform
PostgreSQL
- Common mistakes:sql
SELECT * FROM orders WHERE status = "paid"; -- ❌ column "paid" does not exist SELECT * FROM orders WHERE status = 'paid'; -- ✅ SELECT "createdAt" FROM users; -- ✅ if the column was created with quotes \d users -- psql: list real column names
How to diagnose
- Quotes — Double quotes around a value?
- Case — How is the column really named (\d table)?
- Migrations — Run on this database?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Most viewed in PostgreSQL
- could not connect PostgreSQL: could not connect to server / connection refused — Is the server running on host and accepting TCP/IP connections?
- pg_restore text dump pg_restore: error: input file appears to be a text format dump. Please use psql.
- 25P02 ERROR: current transaction is aborted, commands ignored until end of transaction block
Other ways to find it
Where this error sits
Origin: Data. Errors that are often confused with or caused by this one (click to open):
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 12 Oct 2026