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

syntax_error INSERT has more expressions than target columns — 42601

PostgreSQL error "INSERT has more expressions than target columns" (SQLSTATE 42601): what it means, common causes, and how to fix it.

PG 12, 13, 14, 15, 16, 17, 18 Official docs
Last reviewed May 2025 Grounded in source

Diagnostic Queries

Symptoms

An INSERT supplied more values than the target column list (or table) has columns. PostgreSQL reports SQLSTATE 42601 (syntax_error) because the row shape does not match the target.

  • The caret points at the first extra value.
  • Often caused by a column being dropped or the VALUES list drifting out of sync.
  • The mirror error “has more target columns than expressions” means the opposite mismatch.

What the server log shows

ERROR:  INSERT has more expressions than target columns
LINE 1: INSERT INTO t (a, b) VALUES (1, 2, 3);
                                            ^

Why PostgreSQL raises this — what the manual says

As the INSERT reference (Parameters) explains:

An INSERT must supply no more values than there are target columns; providing extra expressions beyond the explicit or implicit column list leaves values with no column to receive them, so PostgreSQL reports this error.

PostgreSQL maps VALUES left-to-right onto the target column list. If there are more value expressions than target columns, the extras have nowhere to go and the statement fails with 42601.

Common causes

  • An extra value in the VALUES list.
  • Omitting the column list and not matching the table’s exact column count/order.
  • A column dropped from the table but still present in the INSERT.

How to fix it

  1. Match counts: list the columns explicitly and provide exactly one value each.
  2. Remove the extra value, or add the missing column to the target list.
  3. Always specify an explicit column list so schema changes do not silently break inserts.

Related & next steps

Reference: PostgreSQL 18 — INSERT.

Was this helpful?