SQLSTATE 0A000 ERROR Class 0A: Feature Not Supported

feature_not_supported cross-database references are not implemented: “…” — 0A000

PostgreSQL error "cross-database references are not implemented: "…"" (SQLSTATE 0A000): 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

A query tried to reference an object in another database using a database-qualified name. PostgreSQL does not support cross-database queries and raises SQLSTATE 0A000 (feature_not_supported).

  • Triggered by names like otherdb.public.table.
  • A single connection can only see objects in its own database.
  • Use foreign data wrappers or dblink for cross-database access.

What the server log shows

ERROR:  cross-database references are not implemented: "otherdb.public.orders"

Why PostgreSQL raises this — what the manual says

As the postgres_fdw documentation explains:

PostgreSQL does not support directly referencing tables that live in another database from within a single query; to read data in a different database, map its tables into the current one with a foreign-data wrapper such as postgres_fdw (or use the dblink module).

Each connection is bound to one database; the planner cannot resolve names that reference a different database, so it rejects them with 0A000. Cross-database access requires an external mechanism.

Common causes

  • Writing a three-part name with a different database prefix.
  • Porting SQL from systems that support cross-database queries.
  • Expecting db.schema.table to span databases.

How to fix it

  1. Use the postgres_fdw extension to query foreign tables.
  2. Use the dblink extension for ad-hoc cross-database calls.
  3. Consolidate the objects into one database (use schemas to separate them).

Related & next steps

Reference: PostgreSQL 18 — postgres_fdw.

Was this helpful?