SQLSTATE 42703 ERROR Class 42: Syntax Error or Access Rule Violation

undefined_column column “…” of relation “…” does not exist — 42703

PostgreSQL error “column … of relation … does not exist — 42703” (SQLSTATE 42703): what it means, common causes, and how to fix it.

PG 9.6, 10, 11, 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed Jun 2026 Grounded in source

Diagnostic Queries

Symptoms

A statement referenced a column that does not exist on the given relation. PostgreSQL raises SQLSTATE 42703 (undefined_column).

  • The named column isn’t present on that table.
  • Common in ALTER TABLE/INSERT/UPDATE column lists.
  • Often a typo or a column not yet added.

What the server log shows

ERROR:  column "totl" of relation "orders" does not exist

Why PostgreSQL raises this — what the manual says

As Section 5.7 Modifying Tables explains:

The column named in the statement does not exist on the target table — column references must match an existing column name exactly, so verify the spelling and the table you are altering or querying.

Column references are resolved against the relation’s defined columns. A name not present on that table (typo, dropped, or never added) cannot be resolved, so PostgreSQL reports 42703.

Common causes

  • A typo or wrong case in the column name.
  • The column was dropped or never added.
  • Referencing a column on the wrong relation.

How to fix it

  1. Inspect columns: \d tablename or query information_schema.columns.
  2. Correct the column name (mind quoting/case).
  3. Add the column first if your schema expects it.

Related & next steps

Reference: PostgreSQL 18 Section 5.4 “Modifying Tables”.

Was this helpful?