HV00Q — fdw_schema_not_found
HV00Q is a concrete postgresfdw import error. Its remote connection runs an exact pgcatalog.pg_namespace lookup for the requested nspname; when the result count is not exactly one, the wrapper reports the remote schema by name.
English manual coverage begins with PostgreSQL 8.1. Source history and runtime observations have their own recorded version boundaries.
Reading PG 18·Select a recorded version
- aliases
- Unknown
- class name
- Foreign Data Wrapper Error (SQL/MED)
- condition name
- fdw_schema_not_found
- lang
- en
- sqlstate
- HV00Q
Definition PG 18
HV00Q — fdw_schema_not_found
At a glance {#at-a-glance}
HV00Q is a concrete postgres_fdw import error. Its remote connection runs an exact pg_catalog.pg_namespace lookup for the requested nspname; when the result count is not exactly one, the wrapper reports the remote schema by name.
Meaning and message {#meaning}
In postgres_fdw.c:5515-5526, the import path sends SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname = ... on the mapped remote connection, checks PQntuples(res) != 1, and raises ERROR: schema "%s" is not present on foreign server "%s". The requested remote schema and server name are dynamic fields. The fixed query does not use the local search_path; a connection/query failure is handled earlier, while later remote privileges are a separate import concern.
Diagnosis {#diagnosis}
Check the IMPORT FOREIGN SCHEMA source name, remote database, mapped user, and the exact postgres_fdw server options. Confirm the mapped remote connection can run the fixed pg_catalog.pg_namespace lookup for the exact name; do not diagnose this branch from the local search_path. Distinguish a zero-or-unexpected-row result from a connection/query error reported earlier, and check remote schema/table privileges separately when the import proceeds.
Response {#response}
Use the remote schema's exact name, create it remotely if appropriate, or import from the correct foreign server/database. In autocommit, rerun only after the remote catalog state or mapping is corrected. Inside an explicit transaction, an ERROR leaves the local transaction failed; issue ROLLBACK, or ROLLBACK TO a previously established and still usable SAVEPOINT, before retrying the corrected import. Do not replay the command inside an INERROR transaction.
Messages and diagnostics {#messages}
The fixed call group is severity ERROR, primary message schema "%s" is not present on foreign server "%s", with no detail or hint. Keep the remote schema/server values and wrapper version.
Versions {#versions}
HV00Q is present from 9.1.0 through 18.6 and 19 Beta 3. Older wording or catalog-query details may vary; the 18.6 path is fixed to commit 724edf9bde9d356724ad384a2e196edc3c9f80f7.
Related {#related}
HV00P means the wrapper lacks schema-import support; 3D000 is a local database-not-found code; HV00D concerns invalid wrapper options.
Sources {#sources}
errcodes.txt— definition, SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba.postgres_fdw.c— remotepg_namespacequery, result check, and message.- Transaction and savepoint recovery — the explicit-transaction recovery boundary; fixed
xact.sgmlSHA-256b48fbe8bd02ce3d1181a350c88c8baa6e11c73edc90a936e77b180daef328c5c. - Structured evidence — source path and message grouping.
Compare versions
SQLSTATE evidence and recorded runtime versions
claims · identity
{
"claim_id": "identity",
"limits": "",
"method": "Read the fixed definition row and macro.",
"position": 0,
"runtime": [],
"sources": [
"src.errcodes.18.6"
],
"statement": "HV00Q is fdw_schema_not_found in SQL/MED Class HV."
}claims · remote-schema-check
{
"claim_id": "remote-schema-check",
"limits": "The check uses the mapped remote connection and an exact nspname comparison; local search_path does not choose the schema. Connection or remote query errors are reported by an earlier path, and later schema/table privileges are separate from this existence check.",
"method": "Read the fixed remote pg_namespace query and PQntuples result check.",
"position": 1,
"runtime": [],
"sources": [
"src.postgres_fdw.main.18.6"
],
"statement": "postgres_fdw runs SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname = \u003cremote_schema\u003e on the remote connection and emits HV00Q when that query does not return exactly one row."
}claims · transaction-boundary
{
"claim_id": "transaction-boundary",
"limits": "No natural postgres_fdw runtime was run in this batch; the transaction guidance is the general ERROR boundary, not a claim about a selected remote topology.",
"method": "Combine the fixed ERROR severity with the PostgreSQL transaction and savepoint recovery documentation.",
"position": 2,
"runtime": [],
"sources": [
"src.postgres_fdw.main.18.6",
"doc.transactions.18"
],
"statement": "This source path reports ERROR; in an explicit local transaction, the caller must roll back the failed transaction or roll back to a deliberately established savepoint before sending another command."
}messages · remote-schema-not-found
{
"limits": "",
"message_id": "remote-schema-not-found",
"path": "contrib/postgres_fdw/postgres_fdw.c:5523-5526",
"position": 0,
"raw": {
"id": "remote-schema-not-found",
"message": "schema \"%s\" is not present on foreign server \"%s\"",
"path": "contrib/postgres_fdw/postgres_fdw.c:5523-5526",
"severity": "ERROR",
"source_ids": [
"src.postgres_fdw.main.18.6"
],
"sqlstate": "HV00Q"
},
"severity": "ERROR",
"sources": [
"src.postgres_fdw.main.18.6"
],
"templates": [
{
"kind": "primary",
"literal": "schema \" \" is not present on foreign server \" \"",
"position": 0,
"role": "observed",
"template": "schema \"%s\" is not present on foreign server \"%s\""
}
]
}sources · src.errcodes.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "src/backend/utils/errcodes.txt",
"position": 0,
"sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
"source_id": "src.errcodes.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt"
}sources · src.postgres_fdw.main.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/postgres_fdw/postgres_fdw.c",
"position": 1,
"sha256": "5f61f89fc1f9d67a204c47fd993db575b2d619449e5238b536b9fb1877037db6",
"source_id": "src.postgres_fdw.main.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/postgres_fdw/postgres_fdw.c"
}sources · doc.transactions.18
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "doc/src/sgml/xact.sgml",
"position": 2,
"sha256": "b48fbe8bd02ce3d1181a350c88c8baa6e11c73edc90a936e77b180daef328c5c",
"source_id": "doc.transactions.18",
"tag": "PG18-docs",
"url": "https://www.postgresql.org/docs/18/tutorial-transactions.html"
}sources · src.calls.REL_18_6
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "raw/calls/REL_18_6.jsonl",
"position": 3,
"sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
"source_id": "src.calls.REL_18_6",
"tag": "",
"url": ""
}Source references
Full definition and evidence JSON
Definition sources
center · PostgreSQL 18 · english-manuals:4d46c2a8fec175f511dc709cc0ffde82a7df5c146266c7bccd13a8c511451fb2
Text language: en · english-manuals:4d46c2a8fec175f511dc709cc0ffde82a7df5c146266c7bccd13a8c511451fb2