SQLSTATE 428C9 ERROR Class 42: Syntax Error or Access Rule Violation

generated_always column “…” can only be updated to DEFAULT — 428C9

PostgreSQL error "column "…" can only be updated to DEFAULT" (SQLSTATE 428C9): 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 UPDATE tried to set a new value on a GENERATED ALWAYS stored column. Such columns can only be set to DEFAULT (to recompute), so PostgreSQL raises SQLSTATE 428C9 (generated_always).

  • The target is a stored generated column.
  • You may only assign DEFAULT to it.
  • Common when updating a computed column directly.

What the server log shows

ERROR:  column "full_name" can only be updated to DEFAULT
DETAIL:  Column "full_name" is a generated column.

Why PostgreSQL raises this — what the manual says

Section 5.5 Generated Columns:

“In INSERT or UPDATE commands, a value cannot be specified for a generated column, but the keyword DEFAULT may be specified.”

A stored generated column’s value is always derived from its expression. Writing an arbitrary value would break that invariant, so PostgreSQL only allows assigning DEFAULT (recompute) and otherwise reports 428C9.

Common causes

  • Updating a generated column with a literal/expression.
  • An ORM including the generated column in the SET list.
  • Expecting to override a computed value directly.

How to fix it

  1. Remove the generated column from the UPDATE SET list.
  2. Assign DEFAULT to force recomputation if needed.
  3. Change the source columns that feed the generation expression instead.

Related & next steps

Reference: PostgreSQL 18 Section 5.4 “Generated Columns”.

Was this helpful?