PostgreSQL error code
PostgreSQL error 42P10
42P10 is the SQLSTATE PostgreSQL reports for invalid column reference, in class 42, Syntax Error or Access Rule Violation.
| SQLSTATE | 42P10 |
|---|---|
| Condition name | invalid_column_reference |
| Class | 42 — Syntax Error or Access Rule Violation |
Reproduce it, then fix it
These are the queries from the guide below. Run the broken query to see the error, then switch to the fixed one. Edit either freely; every run is rolled back.
SELECT DISTINCT country FROM demo.customers ORDER BY created_at;
SELECT country FROM demo.customers GROUP BY country ORDER BY MIN(created_at);