PostgreSQL error code
PostgreSQL error 42602
42602 is the SQLSTATE PostgreSQL reports for invalid name, in class 42, Syntax Error or Access Rule Violation.
| SQLSTATE | 42602 |
|---|---|
| Condition name | invalid_name |
| Class | 42 — Syntax Error or Access Rule Violation |
Reproduce it, then fix it
demo. has nothing after the dot, so it isn’t a valid name. This usually comes from gluing a schema to an empty table name in code. Run the broken query to see the error, then switch to the fixed one. Edit either freely; every run is rolled back.
SELECT 'demo.'::regclass;
SELECT 'demo.products'::regclass;