cannot use column references in default expression

SQLSTATE 0A000 condition feature_not_supported class 0A — Feature Not Supported severity ERROR
Reproduced & verified on PostgreSQL 14.23, 15.18, 16.14, 17.10 and 18.4 — identical message on every version.
Last reviewed 11 Jun 2026 · Reproduced live with the SQL on this page.

Symptoms

A column DEFAULT expression referenced another column, which PostgreSQL does not support. It raises SQLSTATE 0A000 (feature_not_supported).

What the server log shows

ERROR:  cannot use column references in default expression

Why PostgreSQL raises this — what the manual says

As Section 5.2 Default Values explains:

The DEFAULT expression referenced another column of the table, which is not permitted because defaults are computed without access to the rest of the row; use a generated column or trigger for cross-column logic.

A column DEFAULT is evaluated before the row’s other values are known, so it cannot reference sibling columns. Such a reference is unsupported and PostgreSQL reports 0A000.

Common causes

How to fix it

  1. Use a generated column: GENERATED ALWAYS AS (…) STORED.
  2. Compute the value in a BEFORE INSERT/UPDATE trigger.
  3. Set the value explicitly in the application or query.

Related & next steps

Reference: PostgreSQL 18 Section 5.4 “Default Values”.