SQLSTATE 42704Severity lowLab verified

Incident brief

Undefined data type

Referencing a type that has not been created (or is misspelled or out of the search_path) raises this undefined-object error; 'currency' is not a built-in type.

Reproduced on PostgreSQL 18.4Verified 2026-07-24 (isolated lab, PostgreSQL 18.4)Reviewed by Verified against PostgreSQL 18.4 in an isolated lab environment

In 10 seconds

What
Undefined data type
What triggers it
Create a table (or cast) that references a type name that does not exist.
The fix
Use an existing type (numeric, money, or a DOMAIN/type you have created).
Proof
Reproduced on PostgreSQL 18.4 → A single statement reproduces SQLSTATE 42704; the unknown type name is rejected and the LINE points at it.

The fix

What to do right now

The immediate, application-level response to this error.

  • Use an existing type (numeric, money, or a DOMAIN/type you have created).
  • Create the missing type/domain first, or schema-qualify it if it lives elsewhere.
Fix — SQL
-- Use an existing type (or create it first).
CREATE TABLE ledger (amount numeric);

Related & next steps

Follow the thread

Everything this error touches — jump straight to the sibling error, term, runbook, or parameter.

Verification

PG 18.4
Last verified
2026-07-24 (isolated lab, PostgreSQL 18.4)
Reviewed by
Verified against PostgreSQL 18.4 in an isolated lab environment
Audit status
reviewed