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
- incompatible data directory FATAL: database files are incompatible with server — The data directory was initialized by PostgreSQL version 15, which is not compatible with this version 16
- 23505 PostgreSQL: ERROR: duplicate key value violates unique constraint
- 22P02 uuid ERROR: invalid input syntax for type uuid: "x"
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