Seaquel
PostgreSQL error code

PostgreSQL error 42703

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

SQLSTATE42703
Condition nameundefined_column
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 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;

How to fix it

In other databases

Source: PostgreSQL documentation, Appendix A