08001 — 无法建立 SQL 连接(sqlclient_unable_to_establish_sqlconnection)
无法建立到目标服务器的新连接。
英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。
当前阅读 PG 18·选择有来源记录的版本
- aliases
- 未知
- class name
- Connection Exception
- condition name
- sqlclient_unable_to_establish_sqlconnection
- lang
- en
- sqlstate
- 08001
版本定义 PG 18
08001 — 无法建立 SQL 连接
速览 {#at-a-glance}
SQLSTATE 08001 是 Class 08 中的 sqlclient_unable_to_establish_sqlconnection。08001 是服务器端无法建立客户端连接时使用的 SQLSTATE。选定的 dblink_connect 路径 ERROR 主报文为 could not establish connection,拒绝端口原因放在动态 DETAIL 中;这与 dblink 句柄不存在的 08003,以及启动阶段的 28000、28P01、3D000 不同。
含义 {#meaning}
服务器端 dblink_connect 路径在 libpq 无法打开目标远端端点时发出此码。固定诊断为 ERROR,主报文是 could not establish connection,端点和操作系统原因放在动态 DETAIL 中。它描述的是建立命名远端句柄,与句柄不存在的 08003,以及会话尚未建立就被拒绝的 28000 或 3D000 不同。
源码并不自行格式化 DETAIL:dblink.c 通过 errdetail_internal("%s", msg) 传递 libpq 已经组装好的错误字符串。因此,下面选定运行中的 18.6 拒绝端口文本(含主机、端口和 Connection refused)以及 10.21 的 libpq 文本都只是运行观察,不是 PostgreSQL 固定的 08001 模板。
诊断 {#diagnosis}
记录目标主机、端口、认证参数和完整 DETAIL。选定的 18.6/10.21 运行中,拒绝连接后本地自动提交会话保持 IDLE;随后用真实 dblink 句柄连到运行器实例,执行远端 SELECT 1,再显式断开。它证明本地恢复和句柄清理,不证明任何远端业务事务已经完成。
先判断失败阶段再重试。TCP 拒绝、DNS/TLS 失败和认证拒绝都可能由 libpq 通过这个 dblink 路径返回,必须查看动态 DETAIL,不能只按代码分类。若调用位于显式本地事务中,ERROR 可能使事务在 ROLLBACK(或 ROLLBACK TO SAVEPOINT)前不可继续;选定案例中的自动提交 IDLE 不能推广到显式事务。dblink 句柄属于创建它的后端,应在同一会话或同一个连接池成员中检查和修复。
处理 {#response}
修正端点或连接参数,建立新句柄并先验证无副作用的远端探针,再发送业务操作。若失败请求可能已经越过远端边界,重试前先对账;单凭 08001 不能重放非幂等操作。
自动提交时,修正端点后可以把建连当作新的语句重试,所有者会话仍可能可用。显式事务中应先恢复本地事务,再建立并探测新句柄;只有周围工作明确设计为可继续时,保存点才适合使用。若远端操作可能已经到达目标而本地只收到错误,重放前先核对结果。
实测诊断 {#messages}
固定的 dblink_connect 路径以 ERROR 发出主报文 could not establish connection,并通过 errdetail_internal("%s", msg) 传递动态 libpq 字符串。选定的 18.6 运行中该值为 connection to server at "127.0.0.1", port 1 failed: Connection refused 及 libpq 的后续提示;10.21 运行中则以 could not connect to server: Connection refused 开头。这些是运行特定值,不是固定 SQLSTATE 模板。其他 producer 可能使用不同文本;只有客户端异常而没有服务器诊断,不能据此认定此 SQLSTATE。
这个 dblink 路径的严重级别固定为 ERROR。选定本地会话使用自动提交,所以错误后仍为 IDLE;不要把这个状态推广到外层显式事务,或推广到未能确认结果的远端事务。
代表案例 {#case}
此 SQL 块创建 dblink,尝试连接运行器本地的拒绝端口,然后探测所有者会话。触发点是服务器端 dblink 建连,不会在远端事务中执行工作。
runner_host、runner_port、runner_db 和 runner_user 是运行器占位参数,手工复制时不能照字面使用。应替换为可访问的目标和有权连接它的登录角色;安装/使用 dblink 以及远端登录都需要相应权限。若要复现选定的恢复观察,应在同一个所有者后端中按案例的自动提交边界执行这些语句。
CREATE EXTENSION IF NOT EXISTS dblink;
SELECT dblink_connect('missing_remote', 'host=127.0.0.1 port=1 dbname=postgres connect_timeout=1');
SELECT dblink_connect('working_remote', 'host=runner_host port=runner_port dbname=runner_db user=runner_user connect_timeout=5');
SELECT * FROM dblink('working_remote', 'SELECT 1') AS result(value integer);
SELECT dblink_disconnect('working_remote');
SELECT 1;
18.6 运行记录 SQLSTATE 为 08001,主报文 could not establish connection;错误后所有者会话为 IDLE。修复打开句柄返回 OK,远端返回 1,断开返回 OK;最终探针返回 1,状态 IDLE。10.21 也通过同样断言。
可下载的案例与证据投影分别是 08001 案例 JSON 和 作者证据。运行器清单为 verify/cases/08001/cases.json;发布前会将页面 SQL 与共享注册表比对。
版本 {#versions}
上面的生成事实表记录锁定的目录快照和最早观察到的定义。本页自然运行范围是 PostgreSQL 18.6 与 10.21,不能据此推断所有中间版本的行为。
相关 {#related}
08000— connection_exception08003— connection_does_not_exist28000— invalid_authorization_specification3D000— invalid_catalog_name
来源 {#sources}
src.dblink-connect.18.6—contrib/dblink/dblink.catREL_18_6commit724edf9bde9d356724ad384a2e196edc3c9f80f7; fixed blob SHA-256e4cfaec3a0a1e5d23fded584725e0f6cf7a17321ad99e5fe046e8b7f97416f15(source).src.dblink-connect.10.23—contrib/dblink/dblink.catREL_10_23commit02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; fixed blob SHA-2562d542cc722ba361bd59990aaed7fe7c0f8e147155df5e5fcd56ee03b4dd27c61(source).src.calls.REL_18_6/src.calls.REL_10_23— fixed local call scans, SHA-2569ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf/00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c; these scans preserve the resolved call context used by the claims.
比较版本
SQLSTATE 证据与已记录的运行版本
cases · dblink_connect_failure
{
"assertions": [
"The selected server diagnostic has the expected SQLSTATE",
"The selected recovery/probe assertions pass",
"Runner-owned resources are cleaned up"
],
"case_id": "dblink_connect_failure",
"cleanup": "Drop the case schema with an owner connection.",
"has_snippet": true,
"position": 0,
"preconditions": [
"A runner-owned disposable target is provisioned."
],
"repair": "Follow the case-specific repair statements and verify the resulting state.",
"trigger": "Connect to a runner-local refused port through server-side dblink.",
"versions": [
"10",
"18"
]
}claims · identity.class-and-condition
{
"claim_id": "identity.class-and-condition",
"limits": "Directory identity does not identify every backend or client path.",
"method": "Read the fixed errcodes.txt definition and the locked catalogue metadata.",
"position": 0,
"runtime": [],
"sources": [
"src.errcodes.18.6"
],
"statement": "08001 is the sqlclient_unable_to_establish_sqlconnection condition in Class 08."
}claims · mechanism.backend-path
{
"claim_id": "mechanism.backend-path",
"limits": "Other calls can retain the same SQLSTATE with different context or text.",
"method": "Trace the resolved source call records at the fixed release commits and compare their dynamic message fields.",
"position": 1,
"runtime": [],
"sources": [
"src.dblink-connect.18.6",
"src.dblink-connect.10.23"
],
"statement": "The fixed source paths associated with 08001 report the condition in the mechanism selected for this page."
}claims · runtime.representative-case
{
"claim_id": "runtime.representative-case",
"limits": "This covers the selected case and versions only; it does not generalize to every driver, proxy, or intermediate release.",
"method": "Run the shared registry case on isolated runner-owned latest and PG10 targets; inspect the final summaries and raw results.",
"position": 2,
"runtime": [
"runtime.08001-dblink-repair-latest2.latest",
"runtime.08001-dblink-repair-pg10c.pg10"
],
"sources": [
"snippet-registry.08001",
"manifest.08001"
],
"statement": "The selected dblink_connect_failure case passed with the expected structured diagnostics, recovery assertions, and cleanup on PostgreSQL 18.6 and 10.21."
}claims · transaction-boundary
{
"claim_id": "transaction-boundary",
"limits": "No explicit-transaction dblink runtime was selected in this batch; the transaction guidance is the general ERROR boundary, not a claim about a specific remote topology.",
"method": "Combine the fixed dblink ERROR source path with the official transaction and savepoint recovery contract.",
"position": 3,
"runtime": [],
"sources": [
"src.dblink-connect.18.6",
"doc.transactions.18"
],
"statement": "The selected dblink ERROR is observed under autocommit, where the owner session remains IDLE; when the same ERROR occurs inside an explicit transaction, PostgreSQL's transaction recovery rules require rollback or an intentional savepoint before unrelated work."
}claims · versions.catalogue-boundary
{
"claim_id": "versions.catalogue-boundary",
"limits": "Presence in a definition file is not an exact behavioral introduction; the two runtime targets do not prove all middle versions.",
"method": "Read the generated facts block and locked manifest, then compare the selected target summaries.",
"position": 4,
"runtime": [],
"sources": [
"src.errcodes.18.6",
"src.calls.REL_18_6",
"src.calls.REL_10_23"
],
"statement": "The locked catalogue records 08001 in the listed snapshots; the runtime comparison here is limited to PostgreSQL 18.6 and 10.21."
}messages · message.dblink-establish
{
"limits": "",
"message_id": "message.dblink-establish",
"path": "",
"position": 0,
"raw": {
"detail_boundary": "The fixed dblink.c call passes libpq's already-assembled connection error through errdetail_internal(\"%s\", msg); the refused-port text below is an observation from the selected run, not a PostgreSQL format template.",
"detail_template": "%s",
"id": "message.dblink-establish",
"primary_template": "could not establish connection",
"severity_source": "explicit ERROR",
"sources": [
"src.dblink-connect.18.6",
"src.dblink-connect.10.23"
],
"sqlstate": "08001"
},
"severity": "explicit ERROR",
"sources": [
"src.dblink-connect.18.6",
"src.dblink-connect.10.23"
],
"templates": [
{
"kind": "primary",
"literal": "could not establish connection",
"position": 0,
"role": "",
"template": "could not establish connection"
},
{
"kind": "detail",
"literal": "",
"position": 1,
"role": "",
"template": "%s"
}
]
}runtimes · runtime.08001-dblink-repair-latest2.latest · 18.6 (Homebrew) · passed
{
"cases": [
"dblink_connect_failure"
],
"limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
"position": 0,
"raw": {
"assertions": [
{
"expected": "08001",
"name": "dblink connection SQLSTATE",
"observed": "08001",
"passed": true
},
{
"expected": "could not establish connection",
"name": "dblink connection diagnostic",
"observed": "could not establish connection",
"passed": true
},
{
"expected": "IDLE",
"name": "failed connection attempt leaves session usable",
"observed": "IDLE",
"passed": true
},
{
"expected": "OK and remote SELECT 1",
"name": "correct dblink connection can be repaired",
"observed": {
"open": "OK",
"remote": 1
},
"passed": true
},
{
"expected": "OK",
"name": "named dblink handle is explicitly released",
"observed": "OK",
"passed": true
},
{
"expected": "SELECT 1 and IDLE",
"name": "owner session remains usable",
"observed": {
"probe": 1,
"status": "IDLE"
},
"passed": true
}
],
"case_manifest": "verify/cases/08001/cases.json",
"case_manifest_sha256": "d1310befd467814a86638f37b0b2fc4ede637b6a459e511d5e9eacccf0e1cadd",
"cases": [
"dblink_connect_failure"
],
"cleanup": {
"case": {
"errors": [],
"passed": true
},
"target_stop": {
"argv": [
"/opt/homebrew/Cellar/postgresql@18/18.6/bin/pg_ctl",
"-D",
"/Users/vonng/pgcenter/err-code/.cache/runtime/08001-dblink-repair-latest2/latest/data",
"-m",
"fast",
"-w",
"stop"
],
"elapsed_seconds": 0.107,
"returncode": 0,
"stderr": "",
"stdout": "waiting for server to shut down.... done\nserver stopped\n"
}
},
"environment": {
"lc_messages": "C",
"libpq_version": "18.6",
"locale": "en_US.UTF-8",
"log_destination": "csvlog,jsonlog",
"machine": "arm64",
"platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
"psycopg_version": "3.3.5",
"python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
"server_version": "18.6 (Homebrew)",
"server_version_num": "180006",
"target_kind": "latest"
},
"id": "runtime.08001-dblink-repair-latest2.latest",
"kind": "runtime_observation",
"limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
"observed": {
"connection_autocommit": true,
"connection_scope": "server-side dblink connection to the same runner-owned target and a refused runner-local port",
"dblink_repair": {
"disconnected": "OK",
"opened": "OK",
"remote_probe": 1
},
"diagnostic": {
"column_name": null,
"constraint_name": null,
"context": null,
"datatype_name": null,
"exception_type": "SqlclientUnableToEstablishSqlconnection",
"internal_position": null,
"internal_query": null,
"message_detail": "connection to server at \"127.0.0.1\", port 1 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?",
"message_hint": null,
"message_primary": "could not establish connection",
"schema_name": null,
"severity": "ERROR",
"severity_nonlocalized": "ERROR",
"source_file": "dblink.c",
"source_function": "dblink_connect",
"source_line": "338",
"sqlstate": "08001",
"statement_position": null,
"table_name": null,
"text": "could not establish connection\nDETAIL: connection to server at \"127.0.0.1\", port 1 failed: Connection refused\n\tIs the server running on that host and accepting TCP/IP connections?"
},
"probe": 1,
"statuses": {
"after_error": "IDLE",
"final": "IDLE"
}
},
"raw": "verify/results/08001-dblink-repair-latest2/latest/raw.jsonl",
"raw_sha256": "076f97e40f38907d27d3436ac7657fefbb521ef313898410efabc7032908092a",
"run_id": "08001-dblink-repair-latest2",
"server_version": "18.6 (Homebrew)",
"server_version_num": 180006,
"snippet_registry": {
"path": "verify/cases/08001/snippets.json",
"sha256": "8227f1b7b90faa2fd296bc921279c0f357637ae39695f481f9979af01b22e93e"
},
"status": "passed",
"summary": "verify/results/08001-dblink-repair-latest2/latest/summary.json",
"summary_sha256": "5dace2836aa9b1c47208ad250c2f527fb65c6947db4c7167cb210721eb92b4c6",
"target": "latest"
},
"run_id": "08001-dblink-repair-latest2",
"runtime_id": "runtime.08001-dblink-repair-latest2.latest",
"server_version": "18.6 (Homebrew)",
"status": "passed",
"target": "latest"
}runtimes · runtime.08001-dblink-repair-pg10c.pg10 · 10.21 (Debian 10.21-1.pgdg90+1) · passed
{
"cases": [
"dblink_connect_failure"
],
"limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
"position": 1,
"raw": {
"assertions": [
{
"expected": "08001",
"name": "dblink connection SQLSTATE",
"observed": "08001",
"passed": true
},
{
"expected": "could not establish connection",
"name": "dblink connection diagnostic",
"observed": "could not establish connection",
"passed": true
},
{
"expected": "IDLE",
"name": "failed connection attempt leaves session usable",
"observed": "IDLE",
"passed": true
},
{
"expected": "OK and remote SELECT 1",
"name": "correct dblink connection can be repaired",
"observed": {
"open": "OK",
"remote": 1
},
"passed": true
},
{
"expected": "OK",
"name": "named dblink handle is explicitly released",
"observed": "OK",
"passed": true
},
{
"expected": "SELECT 1 and IDLE",
"name": "owner session remains usable",
"observed": {
"probe": 1,
"status": "IDLE"
},
"passed": true
}
],
"case_manifest": "verify/cases/08001/cases.json",
"case_manifest_sha256": "d1310befd467814a86638f37b0b2fc4ede637b6a459e511d5e9eacccf0e1cadd",
"cases": [
"dblink_connect_failure"
],
"cleanup": {
"case": {
"errors": [],
"passed": true
},
"target_stop": {
"cleanup": {
"argv": [
"/usr/local/bin/docker",
"rm",
"-f",
"-v",
"sqlstate08001_08001dblinkrepairpg10c_pg10"
],
"elapsed_seconds": 0.286,
"returncode": 0,
"stderr": "",
"stdout": "sqlstate08001_08001dblinkrepairpg10c_pg10\n"
},
"inspect": {
"argv": [
"/usr/local/bin/docker",
"inspect",
"sqlstate08001_08001dblinkrepairpg10c_pg10"
],
"elapsed_seconds": 0.016,
"returncode": 0,
"stderr": "",
"stdout": "[\n {\n \"Id\": \"2f98d352570f93b81b370dea5c3f1901ec167149ebd07a60352638bc1ca6d341\",\n \"Created\": \"2026-09-09T15:34:24.994154755Z\",\n \"Path\": \"docker-entrypoint.sh\",\n \"Args\": [\n \"postgres\",\n \"-c\",\n \"listen_addresses=*\",\n \"-c\",\n \"log_destination=csvlog\",\n \"-c\",\n \"logging_collector=on\",\n \"-c\",\n \"log_directory=log\",\n \"-c\",\n \"log_filename=postgresql-%Y%m%d%H%M%S.log\",\n \"-c\",\n \"log_min_messages=error\",\n \"-c\",\n \"log_min_error_statement=error\",\n \"-c\",\n \"log_error_verbosity=verbose\",\n \"-c\",\n \"wal_level=logical\",\n \"-c\",\n \"max_wal_senders=10\",\n \"-c\",\n \"max_replication_slots=10\"\n ],\n \"State\": {\n \"Status\": \"running\",\n \"Running\": true,\n \"Paused\": false,\n \"Restarting\": false,\n \"OOMKilled\": false,\n \"Dead\": false,\n \"Pid\": 57716,\n \"ExitCode\": 0,\n \"Error\": \"\",\n \"StartedAt\": \"2026-09-09T15:34:25.074162839Z\",\n \"FinishedAt\": \"0001-01-01T00:00:00Z\"\n },\n \"Image\": \"sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc\",\n \"ResolvConfPath\": \"/var/lib/docker/containers/2f98d352570f93b81b370dea5c3f1901ec167149ebd07a60352638bc1ca6d341/resolv.conf\",\n \"HostnamePath\": \"/var/lib/docker/containers/2f98d352570f93b81b370dea5c3f1901ec167149ebd07a60352638bc1ca6d341/hostname\",\n \"HostsPath\": \"/var/lib/docker/containers/2f98d352570f93b81b370dea5c3f1901ec167149ebd07a60352638bc1ca6d341/hosts\",\n \"LogPath\": \"/var/lib/docker/containers/2f98d352570f93b81b370dea5c3f1901ec167149ebd07a60352638bc1ca6d341/2f98d352570f93b81b370dea5c3f1901ec167149ebd07a60352638bc1ca6d341-json.log\",\n \"Name\": \"/sqlstate08001_08001dblinkrepairpg10c_pg10\",\n \"RestartCount\": 0,\n \"Driver\": \"overlayfs\",\n \"Platform\": \"linux\",\n \"MountLabel\": \"\",\n \"ProcessLabel\": \"\",\n \"AppArmorProfile\": \"\",\n \"ExecIDs\": null,\n \"HostConfig\": {\n \"Binds\": null,\n \"ContainerIDFile\": \"\",\n \"LogConfig\": {\n \"Type\": \"json-file\",\n \"Config\": {}\n },\n \"NetworkMode\": \"bridge\",\n \"PortBindings\": {\n \"5432/tcp\": [\n {\n \"HostIp\": \"127.0.0.1\",\n \"HostPort\": \"\"\n }\n ]\n },\n \"RestartPolicy\": {\n \"Name\": \"no\",\n \"MaximumRetryCount\": 0\n },\n \"AutoRemove\": false,\n \"VolumeDriver\": \"\",\n \"VolumesFrom\": null,\n \"ConsoleSize\": [\n 0,\n 0\n ],\n \"CapAdd\": null,\n \"CapDrop\": null,\n \"CgroupnsMode\": \"private\",\n \"Dns\": null,\n \"DnsOptions\": [],\n \"DnsSearch\": [],\n \"ExtraHosts\": null,\n \"GroupAdd\": null,\n \"IpcMode\": \"private\",\n \"Cgroup\": \"\",\n \"Links\": null,\n \"OomScoreAdj\": 0,\n \"PidMode\": \"\",\n \"Privileged\": false,\n \"PublishAllPorts\": false,\n \"ReadonlyRootfs\": false,\n \"SecurityOpt\": null,\n \"UTSMode\": \"\",\n \"UsernsMode\": \"\",\n \"ShmSize\": 67108864,\n \"Runtime\": \"runc\",\n \"Isolation\": \"\",\n \"CpuShares\": 0,\n \"Memory\": 0,\n \"NanoCpus\": 0,\n \"CgroupParent\": \"\",\n \"BlkioWeight\": 0,\n \"BlkioWeightDevice\": [],\n \"BlkioDeviceReadBps\": [],\n \"BlkioDeviceWriteBps\": [],\n \"BlkioDeviceReadIOps\": [],\n \"BlkioDeviceWriteIOps\": [],\n \"CpuPeriod\": 0,\n \"CpuQuota\": 0,\n \"CpuRealtimePeriod\": 0,\n \"CpuRealtimeRuntime\": 0,\n \"CpusetCpus\": \"\",\n \"CpusetMems\": \"\",\n \"Devices\": [],\n \"DeviceCgroupRules\": null,\n \"DeviceRequests\": null,\n \"MemoryReservation\": 0,\n \"MemorySwap\": 0,\n \"MemorySwappiness\": null,\n \"OomKillDisable\": null,\n \"PidsLimit\": null,\n \"Ulimits\": [],\n \"CpuCount\": 0,\n \"CpuPercent\": 0,\n \"IOMaximumIOps\": 0,\n \"IOMaximumBandwidth\": 0,\n \"MaskedPaths\": [\n \"/proc/acpi\",\n \"/proc/asound\",\n \"/proc/interrupts\",\n \"/proc/kcore\",\n \"/proc/keys\",\n \"/proc/latency_stats\",\n \"/proc/sched_debug\",\n \"/proc/scsi\",\n \"/proc/timer_list\",\n \"/proc/timer_stats\",\n \"/sys/devices/virtual/powercap\",\n \"/sys/firmware\"\n ],\n \"ReadonlyPaths\": [\n \"/proc/bus\",\n \"/proc/fs\",\n \"/proc/irq\",\n \"/proc/sys\",\n \"/proc/sysrq-trigger\"\n ]\n },\n \"Storage\": {\n \"RootFS\": {\n \"Snapshot\": {\n \"Name\": \"overlayfs\"\n }\n }\n },\n \"Mounts\": [\n {\n \"Type\": \"volume\",\n \"Name\": \"1e6c5835c8f903cced71dc70a20ff91109b11c7b4a5ae698fea98467e5f19950\",\n \"Source\": \"/var/lib/docker/volumes/1e6c5835c8f903cced71dc70a20ff91109b11c7b4a5ae698fea98467e5f19950/_data\",\n \"Destination\": \"/var/lib/postgresql/data\",\n \"Driver\": \"local\",\n \"Mode\": \"\",\n \"RW\": true,\n \"Propagation\": \"\"\n }\n ],\n \"Config\": {\n \"Hostname\": \"2f98d352570f\",\n \"Domainname\": \"\",\n \"User\": \"\",\n \"AttachStdin\": false,\n \"AttachStdout\": false,\n \"AttachStderr\": false,\n \"ExposedPorts\": {\n \"5432/tcp\": {}\n },\n \"Tty\": false,\n \"OpenStdin\": false,\n \"StdinOnce\": false,\n \"Env\": [\n \"POSTGRES_HOST_AUTH_METHOD=trust\",\n \"PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/lib/postgresql/10/bin\",\n \"GOSU_VERSION=1.14\",\n \"LANG=en_US.utf8\",\n \"PG_MAJOR=10\",\n \"PG_VERSION=10.21-1.pgdg90+1\",\n \"PGDATA=/var/lib/postgresql/data\"\n ],\n \"Cmd\": [\n \"postgres\",\n \"-c\",\n \"listen_addresses=*\",\n \"-c\",\n \"log_destination=csvlog\",\n \"-c\",\n \"logging_collector=on\",\n \"-c\",\n \"log_directory=log\",\n \"-c\",\n \"log_filename=postgresql-%Y%m%d%H%M%S.log\",\n \"-c\",\n \"log_min_messages=error\",\n \"-c\",\n \"log_min_error_statement=error\",\n \"-c\",\n \"log_error_verbosity=verbose\",\n \"-c\",\n \"wal_level=logical\",\n \"-c\",\n \"max_wal_senders=10\",\n \"-c\",\n \"max_replication_slots=10\"\n ],\n \"Image\": \"postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc\",\n \"Volumes\": {\n \"/var/lib/postgresql/data\": {}\n },\n \"WorkingDir\": \"\",\n \"Entrypoint\": [\n \"docker-entrypoint.sh\"\n ],\n \"Labels\": {},\n \"StopSignal\": \"SIGINT\",\n \"StopTimeout\": 1\n },\n \"NetworkSettings\": {\n \"SandboxID\": \"5d8478ab84f65a6c2dc840471a1befcdc3ead2876599f0b0c4dcd71c38a4ffc0\",\n \"SandboxKey\": \"/var/run/docker/netns/5d8478ab84f6\",\n \"Ports\": {\n \"5432/tcp\": [\n {\n \"HostIp\": \"127.0.0.1\",\n \"HostPort\": \"62377\"\n }\n ]\n },\n \"Networks\": {\n \"bridge\": {\n \"IPAMConfig\": null,\n \"Links\": null,\n \"Aliases\": null,\n \"DriverOpts\": null,\n \"GwPriority\": 0,\n \"NetworkID\": \"aed51554f8cd8bac69ecd4f073e41e147fda7b458e9d95be2af472651f2e825c\",\n \"EndpointID\": \"8a98a65ddf0f4eae760b2f4f509fb09579287cb9a351bdeda35601de7ded7f74\",\n \"Gateway\": \"172.17.0.1\",\n \"IPAddress\": \"172.17.0.53\",\n \"MacAddress\": \"32:88:0b:fd:4c:0e\",\n \"IPPrefixLen\": 16,\n \"IPv6Gateway\": \"\",\n \"GlobalIPv6Address\": \"\",\n \"GlobalIPv6PrefixLen\": 0,\n \"DNSNames\": null\n }\n }\n },\n \"ImageManifestDescriptor\": {\n \"mediaType\": \"application/vnd.docker.distribution.manifest.v2+json\",\n \"digest\": \"sha256:52aada7978f1eef3b6b52a51afb7a3defd69254d00c946cb90d2ceb32b8ffce7\",\n \"size\": 3246,\n \"platform\": {\n \"architecture\": \"arm64\",\n \"os\": \"linux\",\n \"variant\": \"v8\"\n }\n }\n }\n]\n"
}
}
},
"environment": {
"lc_messages": "en_US.utf8",
"libpq_version": "18.6",
"locale": "en_US.UTF-8",
"log_destination": "csvlog",
"machine": "arm64",
"platform": "macOS-26.6.2-arm64-arm-64bit-Mach-O",
"psycopg_version": "3.3.5",
"python_version": "3.14.6 (main, Jun 10 2026, 10:03:53) [Clang 21.0.0 (clang-2100.0.123.102)]",
"server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
"server_version_num": "100021",
"target_kind": "pg10"
},
"id": "runtime.08001-dblink-repair-pg10c.pg10",
"image": "postgres:10",
"kind": "runtime_observation",
"limits": "Disposable runner-owned target only; this is a bounded mechanism case, not a guarantee for every client or network path.",
"observed": {
"connection_autocommit": true,
"connection_scope": "server-side dblink connection to the same runner-owned target and a refused runner-local port",
"dblink_repair": {
"disconnected": "OK",
"opened": "OK",
"remote_probe": 1
},
"diagnostic": {
"column_name": null,
"constraint_name": null,
"context": null,
"datatype_name": null,
"exception_type": "SqlclientUnableToEstablishSqlconnection",
"internal_position": null,
"internal_query": null,
"message_detail": "could not connect to server: Connection refused\n\tIs the server running on host \"127.0.0.1\" and accepting\n\tTCP/IP connections on port 1?",
"message_hint": null,
"message_primary": "could not establish connection",
"schema_name": null,
"severity": "ERROR",
"severity_nonlocalized": "ERROR",
"source_file": "dblink.c",
"source_function": "dblink_connect",
"source_line": "302",
"sqlstate": "08001",
"statement_position": null,
"table_name": null,
"text": "could not establish connection\nDETAIL: could not connect to server: Connection refused\n\tIs the server running on host \"127.0.0.1\" and accepting\n\tTCP/IP connections on port 1?"
},
"probe": 1,
"statuses": {
"after_error": "IDLE",
"final": "IDLE"
}
},
"raw": "verify/results/08001-dblink-repair-pg10c/pg10/raw.jsonl",
"raw_sha256": "7257f77a09d23b2ae709bd550f2815f3d18b51d7e03bf3760c99211bb945db93",
"run_id": "08001-dblink-repair-pg10c",
"server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
"server_version_num": 100021,
"snippet_registry": {
"path": "verify/cases/08001/snippets.json",
"sha256": "8227f1b7b90faa2fd296bc921279c0f357637ae39695f481f9979af01b22e93e"
},
"status": "passed",
"summary": "verify/results/08001-dblink-repair-pg10c/pg10/summary.json",
"summary_sha256": "339c3ec9564d613ce80e4801dffb5de90b505bd1af2a0f33d84b7ef870643035",
"target": "pg10"
},
"run_id": "08001-dblink-repair-pg10c",
"runtime_id": "runtime.08001-dblink-repair-pg10c.pg10",
"server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
"status": "passed",
"target": "pg10"
}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.calls.REL_18_6
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "raw/calls/REL_18_6.jsonl",
"position": 1,
"sha256": "9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf",
"source_id": "src.calls.REL_18_6",
"tag": "REL_18_6",
"url": ""
}sources · src.calls.REL_10_23
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "raw/calls/REL_10_23.jsonl",
"position": 2,
"sha256": "00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c",
"source_id": "src.calls.REL_10_23",
"tag": "REL_10_23",
"url": ""
}sources · src.dblink-connect.18.6
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/dblink/dblink.c",
"position": 3,
"sha256": "e4cfaec3a0a1e5d23fded584725e0f6cf7a17321ad99e5fe046e8b7f97416f15",
"source_id": "src.dblink-connect.18.6",
"tag": "REL_18_6",
"url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/contrib/dblink/dblink.c#L335-L338"
}sources · src.dblink-connect.10.23
{
"commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "contrib/dblink/dblink.c",
"position": 4,
"sha256": "2d542cc722ba361bd59990aaed7fe7c0f8e147155df5e5fcd56ee03b4dd27c61",
"source_id": "src.dblink-connect.10.23",
"tag": "REL_10_23",
"url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/contrib/dblink/dblink.c#L299-L302"
}sources · doc.transactions.18
{
"commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
"docs_url": "",
"kind": "upstream_source",
"location": "",
"path": "doc/src/sgml/xact.sgml",
"position": 5,
"sha256": "b48fbe8bd02ce3d1181a350c88c8baa6e11c73edc90a936e77b180daef328c5c",
"source_id": "doc.transactions.18",
"tag": "PG18-docs",
"url": "https://www.postgresql.org/docs/18/tutorial-transactions.html"
}sources · manifest.08001
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "verify/cases/08001/cases.json",
"position": 6,
"sha256": "d1310befd467814a86638f37b0b2fc4ede637b6a459e511d5e9eacccf0e1cadd",
"source_id": "manifest.08001",
"tag": "workspace",
"url": "verify/cases/08001/cases.json"
}sources · snippet-registry.08001
{
"commit": "",
"docs_url": "",
"kind": "local_artifact",
"location": "",
"path": "verify/cases/08001/snippets.json",
"position": 7,
"sha256": "8227f1b7b90faa2fd296bc921279c0f357637ae39695f481f9979af01b22e93e",
"source_id": "snippet-registry.08001",
"tag": "workspace",
"url": "verify/cases/08001/snippets.json"
}来源引用
定义来源
center · PostgreSQL 18 · english-manuals:a5abb353e53fa2f90c0570507acb7ee80d6953345afe1e7a1da450ed89d6105a
正文语言: zh-Hans · english-manuals:a5abb353e53fa2f90c0570507acb7ee80d6953345afe1e7a1da450ed89d6105a