ERROR: missing FROM-clause entry for table "x"
The query references a table/alias that isn’t in the FROM clause (or uses the wrong alias).
Seen on:
PostgreSQL
Meaning
After aliasing (users u) you must use u, not users. Also caused by referencing a joined table that wasn’t joined.
Common causes
- Using the table name after aliasing it
- Referencing a table not joined
- Typos in aliases
⚡ Quick fix
- Use the alias consistently
- Add the missing JOIN
Detailed fix by platform
PostgreSQL
SELECT u.email FROM users u WHERE u.active;
How to diagnose
- Alias — Which name is unknown?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026