PostgreSQL error code
PostgreSQL error 42703
42703 is the SQLSTATE PostgreSQL reports for undefined column, in class 42, Syntax Error or Access Rule Violation.
| SQLSTATE | 42703 |
|---|---|
| Condition name | undefined_column |
| 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 name, price * stock_quantity AS stock_value FROM demo.products WHERE stock_value > 5000;
SELECT name, price * stock_quantity AS stock_value FROM demo.products WHERE price * stock_quantity > 5000;