PostgreSQL error code
PostgreSQL error 42P01
42P01 is the SQLSTATE PostgreSQL reports for undefined table, in class 42, Syntax Error or Access Rule Violation.
| SQLSTATE | 42P01 |
|---|---|
| Condition name | undefined_table |
| 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 c.first_name, o.total_amount FROM demo.customers c JOIN demo.orders ON o.customer_id = c.id;
SELECT c.first_name, o.total_amount FROM demo.customers c JOIN demo.orders o ON o.customer_id = c.id;