PostgreSQL: type "..." does not exist
ERROR: type "<name>" does not existYou referenced a data type Postgres does not know. Usually the type is a custom type, enum, or domain that was never created, lives in another schema, or comes from an extension you have not installed.
What this error means
Beyond built-in types, Postgres types can come from CREATE TYPE, CREATE DOMAIN, or extensions like citext and hstore. If the type is missing from every schema on your search_path, this error is raised.
A common case is running code or a restore that expects an extension type before the extension is installed.
How to fix it
The type was never created
Create the enum, domain, or composite type it needs.
CREATE TYPE order_status AS ENUM ('pending', 'paid', 'shipped');It comes from an extension
Install the extension that provides the type.
CREATE EXTENSION IF NOT EXISTS citext;It is in another schema
Schema-qualify the type, or add its schema to the search_path.
SET search_path TO app, public;How to avoid it next time
- Create types and extensions in your migrations before any code references them.
- Schema-qualify types shared across schemas so their location is unambiguous.
Frequently asked questions
Why does citext or hstore fail as a type?
They are provided by extensions. Run CREATE EXTENSION citext; (or hstore) before using the type.
How do I list defined types?
Run \dT in psql to see user-defined types in the current schemas.
Stop struggling with SQL
Use FluentDB, the AI database client for macOS.
Related errors
Part of the PostgreSQL error reference. Last reviewed 2026-07-31.