↑↓ 选择↵ 打开⌫ 切换范围完整搜索

PG.CENTER 连接 PostgreSQL 文档、百科与生态知识。由 Pigsty 维护。

Wiki / SQLSTATE

53100 \u2014 disk_full

写文件时发生短写,通常是磁盘空间耗尽。

英文手册覆盖始于 PostgreSQL 8.1. 来源历史与运行验证各自保留独立版本边界。

当前阅读 PG 18·选择有来源记录的版本

aliases
未知
class name
Insufficient Resources
condition name
disk_full
lang
en
sqlstate
53100

版本定义 PG 18

53100

速览 {#at-a-glance}

53100 表示文件写入进入明确的短写分支。固定路径覆盖基础备份输出和关系文件扩展;诊断会给出文件、已写/请求字节以及 offset 或 block。

含义 {#meaning}

短写消息给出目标文件、已写/请求字节以及 offset 或 block,并提示 Check free disk space.。同一个 md.c 函数先把负的 FileWrite 结果交给 errcode_for_file_access() 和 %m;固定 helper 的 saved-errno 分支把 ENOSPC 映射为 53100,但没有列出 EFBIG 或 EDQUOT,它们会走 ERRCODE_INTERNAL_ERROR 默认分支。这是存储写入边界,不是普通 SQL 数据错误,也不能据此断言宿主卷已满。

诊断 {#diagnosis}

按消息定位文件系统和路径,检查空间、配额、挂载状态、写入错误及受影响的数据库或备份卷,再把 offset/block 和部分字节数与操作及服务器日志对应。若 primary 是 could not ...: %m 而不是短写模板,应检查保存的 errno:固定 helper 把 ENOSPC 映射为 53100,但未列出的 EFBIG 和 EDQUOT 会进入其 internal-error 默认分支。不能把 errno 对应的其他 SQLSTATE 重新标成 53100。

处理 {#response}

在指定文件系统释放或增加容量、修复报告的写入条件,或改用合适目标。部分基础备份或关系写入在验证前都应视为不完整;按该操作的恢复流程处理。显式事务中若发生此 ERROR,重试前执行 ROLLBACK 或 ROLLBACK TO SAVEPOINT;自动提交只有在存储原因修复后才能重试。不要在用户实例制造磁盘压力。

版本 {#versions}

锁定目录从 7.4 记录;引用写入路径来自 PostgreSQL 18.6,未执行磁盘满运行。

相关 {#related}

53000

来源 {#sources}

src/backend/backup/basebackup_server.c#L177-L182

src/backend/storage/smgr/md.c#L521-L526

src/backend/storage/smgr/md.c#L512-L526

src/backend/utils/error/elog.c#L868-L938

结构化证据记录保存固定消息以及源码/运行边界。

比较版本

SQLSTATE 证据与已记录的运行版本

claims · identity
{
  "claim_id": "identity",
  "limits": "",
  "method": "Read fixed definition.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "53100 is disk_full in SQLSTATE Class 53."
}
claims · resolved-paths
{
  "claim_id": "resolved-paths",
  "limits": "Source confirmation is not natural runtime.",
  "method": "Read complete fixed source contexts.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.path.0",
    "src.path.1",
    "src.path.2",
    "src.path.3"
  ],
  "statement": "The cited PostgreSQL 18.6 source paths support the representative resource and object-state mechanisms described."
}
claims · errno-boundary
{
  "claim_id": "errno-boundary",
  "limits": "",
  "method": "Read the complete mdextend error branch.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.path.2"
  ],
  "statement": "The relation write path sends a negative FileWrite result through errcode_for_file_access(), while a short write explicitly uses ERRCODE_DISK_FULL; these are separate source branches."
}
claims · errno-map
{
  "claim_id": "errno-map",
  "limits": "This records the PostgreSQL helper mapping; it does not claim that every operating-system write failure presents this SQLSTATE.",
  "method": "Read the complete saved-errno switch, including its default branch.",
  "position": 3,
  "runtime": [],
  "sources": [
    "src.path.3"
  ],
  "statement": "In the fixed errno helper, ENOSPC maps to ERRCODE_DISK_FULL; EFBIG and EDQUOT are not listed and therefore use the helper's default internal-error mapping."
}
claims · history
{
  "claim_id": "history",
  "limits": "",
  "method": "Use catalogue boundary.",
  "position": 4,
  "runtime": [],
  "sources": [
    "src.errcodes.18.6"
  ],
  "statement": "The locked catalogue records 53100 from 7.4; that boundary does not prove exact implementation introduction."
}
messages · message.0
{
  "limits": "",
  "message_id": "message.0",
  "path": "",
  "position": 0,
  "raw": {
    "hint_template": "Check free disk space.",
    "id": "message.0",
    "primary_template": "could not write file \"%s\": wrote only %d of %d bytes at offset %lld",
    "severity_source": "ERROR",
    "sources": [
      "src.path.0"
    ],
    "sqlstate": "53100"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.0"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "could not write file \" \": wrote only of bytes at offset ld",
      "position": 0,
      "role": "",
      "template": "could not write file \"%s\": wrote only %d of %d bytes at offset %lld"
    },
    {
      "kind": "hint",
      "literal": "Check free disk space.",
      "position": 1,
      "role": "",
      "template": "Check free disk space."
    }
  ]
}
messages · message.1
{
  "limits": "",
  "message_id": "message.1",
  "path": "",
  "position": 1,
  "raw": {
    "hint_template": "Check free disk space.",
    "id": "message.1",
    "primary_template": "could not extend file \"%s\": wrote only %d of %d bytes at block %u",
    "severity_source": "ERROR",
    "sources": [
      "src.path.1"
    ],
    "sqlstate": "53100"
  },
  "severity": "ERROR",
  "sources": [
    "src.path.1"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "could not extend file \" \": wrote only of bytes at block",
      "position": 0,
      "role": "",
      "template": "could not extend file \"%s\": wrote only %d of %d bytes at block %u"
    },
    {
      "kind": "hint",
      "literal": "Check free disk space.",
      "position": 1,
      "role": "",
      "template": "Check free disk space."
    }
  ]
}
messages · message.2
{
  "limits": "The source selects errcode_for_file_access() from errno; this template is not itself proof that the resulting SQLSTATE is 53100.",
  "message_id": "message.2",
  "path": "",
  "position": 2,
  "raw": {
    "id": "message.2",
    "limits": "The source selects errcode_for_file_access() from errno; this template is not itself proof that the resulting SQLSTATE is 53100.",
    "primary_template": "could not extend file \"%s\": %m",
    "severity_source": "ERROR",
    "sources": [
      "src.path.2",
      "src.path.3"
    ]
  },
  "severity": "ERROR",
  "sources": [
    "src.path.2",
    "src.path.3"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "could not extend file \" \":",
      "position": 0,
      "role": "",
      "template": "could not extend file \"%s\": %m"
    }
  ]
}
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#L408"
}
sources · src.path.0
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/backup/basebackup_server.c",
  "position": 1,
  "sha256": "1447d7223926f903d27744605f9caec8a610d78a9f7a7864bb3afb6b3073ac19",
  "source_id": "src.path.0",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/backup/basebackup_server.c#L177"
}
sources · src.path.1
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/storage/smgr/md.c",
  "position": 2,
  "sha256": "c7e885c50b381337b8b8624bfc8effbd3abba7aa95a290083996354926ec9f69",
  "source_id": "src.path.1",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/smgr/md.c#L521"
}
sources · src.path.2
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/storage/smgr/md.c",
  "position": 3,
  "sha256": "c7e885c50b381337b8b8624bfc8effbd3abba7aa95a290083996354926ec9f69",
  "source_id": "src.path.2",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/storage/smgr/md.c#L512"
}
sources · src.path.3
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/error/elog.c",
  "position": 4,
  "sha256": "766d30a426ba1d9597657bd46fb890da3e37e4ae53a83d1245bf082ed9433c33",
  "source_id": "src.path.3",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/error/elog.c#L868"
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:90861ec853e4d0193a88e8a3c0b2c0dc0aba40839c7f093ada82f1415f0a0232

正文语言: zh-Hans · english-manuals:90861ec853e4d0193a88e8a3c0b2c0dc0aba40839c7f093ada82f1415f0a0232