HV00Q — fdw_schema_not_found
IMPORT FOREIGN SCHEMA 找不到请求的远端模式。
英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。
当前阅读 PG 18·选择有来源记录的版本
- aliases
- 未知
- class name
- Foreign Data Wrapper Error (SQL/MED)
- condition name
- fdw_schema_not_found
- lang
- en
- sqlstate
- HV00Q
版本定义 PG 18
HV00Q — fdw_schema_not_found
速览 {#at-a-glance}
HV00Q 是具体的 postgres_fdw 导入错误。远端连接会按请求的 nspname 精确查询 pg_catalog.pg_namespace;结果行数不是恰好一行时,包装器按名称报告远端模式不存在。
含义与消息 {#meaning}
postgres_fdw.c:5515-5526 的导入路径在映射的远端连接上发送 SELECT 1 FROM pg_catalog.pg_namespace WHERE nspname = ...,检查 PQntuples(res) != 1,再报告 ERROR: schema "%s" is not present on foreign server "%s"。请求的远端模式和服务器名称都是动态字段。这个固定查询不使用本地 search_path;连接或查询错误会在更早路径报告,后续远端权限则是导入成功后的另一项检查。
诊断 {#diagnosis}
检查 IMPORT FOREIGN SCHEMA 的源名称、远端数据库、映射用户和 postgres_fdw 服务器选项。确认映射的远端连接能按精确名称执行固定的 pg_catalog.pg_namespace 查询;不要用本地 search_path 推断这一分支。将零行或异常行数与更早发生的连接/查询错误区分开,并在导入继续后另行检查远端模式和表权限。
处理 {#response}
使用远端模式的确切名称,在适当时创建远端模式,或改用正确的外部服务器和数据库。自动提交时,只有远端目录状态或用户映射修正后才重新导入。显式事务中的 ERROR 会使本地事务失败;重试修正后的导入前,先执行 ROLLBACK,或回滚到此前已经建立且仍可用的保存点,不要在 INERROR 事务中重放命令。
消息与诊断 {#messages}
确认的调用组严重级别为 ERROR,主消息是 schema "%s" is not present on foreign server "%s",没有 detail 或 hint。保留远端模式和服务器值,以及包装器版本。
版本 {#versions}
HV00Q 从 9.1.0 到 18.6 以及 19 Beta 3 均存在。旧版本的措辞或目录查询细节可能不同;18.6 路径固定于指定提交。
相关 {#related}
HV00P 表示包装器不支持模式导入;3D000 是本地数据库不存在;HV00D 涉及无效包装器选项。
来源 {#sources}
errcodes.txt— 定义,SHA-2566e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba。postgres_fdw.c— 远端pg_namespace查询、结果检查与消息。- 事务与保存点恢复 — 显式事务恢复边界;固定
xact.sgmlSHA-256b48fbe8bd02ce3d1181a350c88c8baa6e11c73edc90a936e77b180daef328c5c。 - 结构化证据 — 来源路径和消息分组。
比较版本
SQLSTATE 证据与已记录的运行版本
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": ""
}来源引用
定义来源
center · PostgreSQL 18 · english-manuals:4d46c2a8fec175f511dc709cc0ffde82a7df5c146266c7bccd13a8c511451fb2
正文语言: zh-Hans · english-manuals:4d46c2a8fec175f511dc709cc0ffde82a7df5c146266c7bccd13a8c511451fb2