Seaquel
PostgreSQL error code

PostgreSQL error 42P01

42P01 is the SQLSTATE PostgreSQL reports for undefined table, in class 42, Syntax Error or Access Rule Violation.

SQLSTATE42P01
Condition nameundefined_table
Class42 — 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;

How to fix it

In other databases

Source: PostgreSQL documentation, Appendix A