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

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

Wiki / SQLSTATE

42804 — 数据类型不匹配(datatype_mismatch)

表达式类型与目标上下文要求的类型不符。

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

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

aliases
未知
class name
Syntax Error or Access Rule Violation
condition name
datatype_mismatch
lang
en
sqlstate
42804

版本定义 PG 18

42804 — 数据类型不匹配(datatype_mismatch)

速览 {#at-a-glance}

42804 是 datatype_mismatch(数据类型不匹配):表达式或定义类型不同于目标上下文。本页选择整数列使用文本默认值。

含义 {#meaning}

cookDefault 路径报告 column "%s" is of type %s but default expression is of type %s 并提示重写或 cast。同一 SQLSTATE 还覆盖 INSERT/UPDATE 目标赋值的 column "%s" is of type %s but expression is of type %s,以及 CASE/UNION 公共类型选择的 %s types %s and %s cannot be matched。它不同于 22P02(已选类型的输入解析器拒绝值)和 42846(选定公共目标没有转换路径)。检查 pg_attribute.atttypid、pg_type、pg_get_expr 以及实际表达式上下文;自动提交 CREATE 失败后为 IDLE。

诊断 {#diagnosis}

确认目标列或结果类型,再检查 pg_attribute.atttypid、pg_type,以及默认值或生成表达式的 pg_get_expr。INSERT/UPDATE 要对照赋值表达式与目标列类型;CASE/UNION 要检查参与公共类型选择的每个分支或输入。先依据诊断中展开的源/目标类型和位置,再决定 cast。

处理 {#response}

让表达式直接产生目标类型,或添加已理解语义的有效 cast。赋值场景应修正产生方或转成目标列类型;CASE/UNION 应让分支具有预期的公共类型。22P02 的输入错误不能靠改字符串后就当成类型匹配;如果没有转换路径,也应按源码区分 42846,不能误写成 42804。案例用 DEFAULT 1,插入默认行并读回 1。显式事务中定义或赋值失败会进入 INERROR,应先回滚或回到合适的 savepoint;本案例的自动提交失败才会回到 IDLE。

实测诊断 {#messages}

固定源码组都是 ERROR 变体。本案例 heap.c 主模板为 column "%s" is of type %s but default expression is of type %s,提示为 You will need to rewrite or cast the expression.;赋值路径使用 column "%s" is of type %s but expression is of type %s 和同一提示;CASE/UNION 等公共类型路径使用 %s types %s and %s cannot be matched。值输入失败是 22P02;选定公共类型后无法转换表达式则是 42846。

代表案例 {#case}

注册表先定义整数列与显式文本默认值,再创建匹配定义、插入默认行并核对。

CREATE TABLE syntax_schema.mismatch_table (value integer DEFAULT 'x'::text);
CREATE TABLE syntax_schema.mismatch_table (value integer DEFAULT 1);
INSERT INTO syntax_schema.mismatch_table DEFAULT VALUES;
SELECT value FROM syntax_schema.mismatch_table;

选定的 18.6 与 10.21 运行均通过 SQLSTATE、严重级别、状态/恢复、修复、清理和一次性实例停止断言。详见 案例 JSON 与 作者证据;私有清单和注册表哈希也记录在其中。

版本 {#versions}

锁定目录从 7.4 存在边界起包含该条件并列出相关快照。选定自然案例已在 PostgreSQL 18.6 与 10.21 通过;这是有界观察,不能推断所有中间版本或所有源码分支。

相关 {#related}

来源 {#sources}

  • src.errcodes.REL_18_6 — fixed definition at 724edf9bde9d356724ad384a2e196edc3c9f80f7; SHA-256 6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba (source).
  • src.datatype-default.18.6 — src/backend/catalog/heap.c lines 3413–3420 at 724edf9bde9d356724ad384a2e196edc3c9f80f7; blob SHA-256 e720ee58279590793edd0985b3c910970ef56e7361b8ef92e245370587e02a0e (source).
  • src.datatype-default.10.23 — src/backend/catalog/heap.c lines 2679–2686 at 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; blob SHA-256 285e1e2f8024acb58497735bcbd8e605e7cfdd224e442becdee6a5b0e7ac7cf6 (source).
  • src.assignment-target.18.6 — src/backend/parser/parse_target.c lines 575–596 at 724edf9bde9d356724ad384a2e196edc3c9f80f7; blob SHA-256 4f0cda351acc3e2854bf55514e69cf8b7de6ad82e1535045e4523581ca0d943c (source).
  • src.assignment-target.10.23 — src/backend/parser/parse_target.c lines 570–596 at 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; blob SHA-256 808bfadd7717d711bc71eb85b7ecd343c742ccc8f6f3087164ed20da098b6d7d (source).
  • src.common-type.18.6 — src/backend/parser/parse_coerce.c lines 1327–1425 at 724edf9bde9d356724ad384a2e196edc3c9f80f7; blob SHA-256 6ac3ddab06edff28e9a694c64fb7f559315cf488bfa4392bc14c24e559f6bd2e (source).
  • src.common-type.10.23 — src/backend/parser/parse_coerce.c lines 1217–1311 at 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; blob SHA-256 ed778c872fe4f2b8742828795566c3eaa24e7af3ce747fbf844c374d673593d3 (source).
  • src.common-coerce.18.6 — src/backend/parser/parse_coerce.c lines 1564–1593 at 724edf9bde9d356724ad384a2e196edc3c9f80f7; blob SHA-256 6ac3ddab06edff28e9a694c64fb7f559315cf488bfa4392bc14c24e559f6bd2e (source).
  • src.common-coerce.10.23 — src/backend/parser/parse_coerce.c lines 1349–1378 at 02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4; blob SHA-256 ed778c872fe4f2b8742828795566c3eaa24e7af3ce747fbf844c374d673593d3 (source).
  • src.calls.REL_18_6 / src.calls.REL_10_23 — fixed call scans, SHA-256 9ee8a0e81d8f0825c5c1ae45583439859a26e602bdd4ce2f2a62aa278867ccbf / 00d16d3eb01b71ccf1b245c8f3102f9d0ec9f36fb02777b8dd1b99fcb263040c.
  • manifest.42804 / snippet-registry.42804 — hashes are recorded in evidence/42804.json and each runtime record.

比较版本

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

cases · default_type_mismatch
{
  "assertions": [
    "SQLSTATE is 42804 with the type mismatch and rewrite/cast hint",
    "The failed autocommit session remains IDLE",
    "A matching integer default can be inserted and read back"
  ],
  "case_id": "default_type_mismatch",
  "cleanup": "Drop the runner schema and its table.",
  "has_snippet": true,
  "position": 0,
  "preconditions": [
    "A runner-owned disposable target is provisioned."
  ],
  "repair": "Make the expression type match the column or add a deliberate, valid cast; input-value errors such as 22P02 are a different path.",
  "trigger": "Define an integer column whose default expression is explicitly text.",
  "versions": [
    "10",
    "18"
  ]
}
claims · identity.class-and-condition
{
  "claim_id": "identity.class-and-condition",
  "limits": "Identity does not identify every backend call that can reuse this SQLSTATE.",
  "method": "Read fixed errcodes.txt and locked catalogue metadata.",
  "position": 0,
  "runtime": [],
  "sources": [
    "src.errcodes.REL_18_6"
  ],
  "statement": "42804 is the datatype_mismatch condition in Class 42."
}
claims · mechanism.selected-source-path
{
  "claim_id": "mechanism.selected-source-path",
  "limits": "This is one mechanism boundary, not an exhaustive inventory of the code.",
  "method": "Trace the REL_18_6 and REL_10_23 source-call records at the locked commits.",
  "position": 1,
  "runtime": [],
  "sources": [
    "src.datatype-default.18.6",
    "src.datatype-default.10.23"
  ],
  "statement": "The selected default_type_mismatch follows a resolved PostgreSQL source-call group; other branches can use different dynamic fields."
}
claims · mechanism.reader-boundary
{
  "claim_id": "mechanism.reader-boundary",
  "limits": "The claim describes the selected path and does not generalize to every branch sharing this SQLSTATE.",
  "method": "Combine the selected source call, registry SQL, and passed structured assertions.",
  "position": 2,
  "runtime": [],
  "sources": [
    "src.datatype-default.18.6",
    "src.datatype-default.10.23",
    "src.assignment-target.18.6",
    "src.assignment-target.10.23",
    "src.common-type.18.6",
    "src.common-type.10.23",
    "src.common-coerce.18.6",
    "src.common-coerce.10.23",
    "snippet-registry.42804"
  ],
  "statement": "Definition, target-column assignment, and CASE/UNION common-type contexts must agree on types; the fixed assignment and common-type branches are distinct from 22P02 input rejection and 42846 inability to coerce."
}
claims · mechanism.assignment-and-common-type
{
  "claim_id": "mechanism.assignment-and-common-type",
  "limits": "These are source-backed variants; the selected runtime exercised only the default-expression branch.",
  "method": "Read the complete fixed parse_target.c and parse_coerce.c branches in both locked source snapshots.",
  "position": 3,
  "runtime": [],
  "sources": [
    "src.assignment-target.18.6",
    "src.assignment-target.10.23",
    "src.common-type.18.6",
    "src.common-type.10.23",
    "src.common-coerce.18.6",
    "src.common-coerce.10.23"
  ],
  "statement": "transformAssignedExpr raises 42804 when target-column coercion fails, while select_common_type raises 42804 when CASE/UNION inputs have incompatible type categories; a later failed coercion to an already selected common type is 42846."
}
claims · runtime.representative-case
{
  "claim_id": "runtime.representative-case",
  "limits": "Scope is limited to these statements, psycopg, and two versions.",
  "method": "Run the shared SQL registry and inspect SQLSTATE, severity, state, repair, cleanup, and target stop.",
  "position": 4,
  "runtime": [
    "runtime.syntax2-42804-latest.latest",
    "runtime.syntax2-42804-pg10.pg10"
  ],
  "sources": [
    "manifest.42804",
    "snippet-registry.42804"
  ],
  "statement": "The selected default_type_mismatch passed on isolated PostgreSQL 18.6 and 10.21 targets."
}
claims · versions.catalogue-boundary
{
  "claim_id": "versions.catalogue-boundary",
  "limits": "Definition presence is not an exact behavioral introduction; two runtime versions do not prove every intermediate behavior.",
  "method": "Read generated facts, fixed calls, and selected summaries.",
  "position": 5,
  "runtime": [],
  "sources": [
    "src.errcodes.REL_18_6",
    "src.calls.REL_18_6",
    "src.calls.REL_10_23"
  ],
  "statement": "The locked catalogue records 42804 from the 7.4 presence bound through the listed snapshots; runtime scope is 18.6 and 10.21."
}
messages · message.default_type_mismatch
{
  "limits": "",
  "message_id": "message.default_type_mismatch",
  "path": "",
  "position": 0,
  "raw": {
    "hint_template": "You will need to rewrite or cast the expression.",
    "id": "message.default_type_mismatch",
    "primary_template": "column \"%s\" is of type %s but default expression is of type %s",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.datatype-default.18.6",
      "src.datatype-default.10.23"
    ],
    "sqlstate": "42804"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.datatype-default.18.6",
    "src.datatype-default.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "column \" \" is of type but default expression is of type",
      "position": 0,
      "role": "",
      "template": "column \"%s\" is of type %s but default expression is of type %s"
    },
    {
      "kind": "hint",
      "literal": "You will need to rewrite or cast the expression.",
      "position": 1,
      "role": "",
      "template": "You will need to rewrite or cast the expression."
    }
  ]
}
messages · message.assignment_type_mismatch
{
  "limits": "",
  "message_id": "message.assignment_type_mismatch",
  "path": "",
  "position": 1,
  "raw": {
    "hint_template": "You will need to rewrite or cast the expression.",
    "id": "message.assignment_type_mismatch",
    "primary_template": "column \"%s\" is of type %s but expression is of type %s",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.assignment-target.18.6",
      "src.assignment-target.10.23"
    ],
    "sqlstate": "42804"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.assignment-target.18.6",
    "src.assignment-target.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "column \" \" is of type but expression is of type",
      "position": 0,
      "role": "",
      "template": "column \"%s\" is of type %s but expression is of type %s"
    },
    {
      "kind": "hint",
      "literal": "You will need to rewrite or cast the expression.",
      "position": 1,
      "role": "",
      "template": "You will need to rewrite or cast the expression."
    }
  ]
}
messages · message.common_type_mismatch
{
  "limits": "",
  "message_id": "message.common_type_mismatch",
  "path": "",
  "position": 2,
  "raw": {
    "id": "message.common_type_mismatch",
    "primary_template": "%s types %s and %s cannot be matched",
    "scope": "CASE/UNION and similar common-type selection contexts",
    "severity_source": "explicit ERROR",
    "sources": [
      "src.common-type.18.6",
      "src.common-type.10.23"
    ],
    "sqlstate": "42804"
  },
  "severity": "explicit ERROR",
  "sources": [
    "src.common-type.18.6",
    "src.common-type.10.23"
  ],
  "templates": [
    {
      "kind": "primary",
      "literal": "types and cannot be matched",
      "position": 0,
      "role": "",
      "template": "%s types %s and %s cannot be matched"
    }
  ]
}
runtimes · runtime.syntax2-42804-latest.latest · 18.6 (Homebrew) · passed
{
  "cases": [
    "default_type_mismatch"
  ],
  "limits": "",
  "position": 0,
  "raw": {
    "assertions": [
      {
        "expected": "42804",
        "name": "42804 SQLSTATE",
        "observed": "42804",
        "passed": true
      },
      {
        "expected": "ERROR",
        "name": "42804 ERROR severity",
        "observed": "ERROR",
        "passed": true
      },
      {
        "expected": "column \"value\" is of type integer but default expression is of type text",
        "name": "42804 primary diagnostic",
        "observed": "column \"value\" is of type integer but default expression is of type text",
        "passed": true
      },
      {
        "expected": "You will need to rewrite or cast the expression.",
        "name": "datatype mismatch preserves the cast/rewrite hint",
        "observed": "You will need to rewrite or cast the expression.",
        "passed": true
      },
      {
        "expected": "IDLE",
        "name": "datatype mismatch leaves autocommit session usable",
        "observed": "IDLE",
        "passed": true
      },
      {
        "expected": {
          "status": "IDLE",
          "value": 1
        },
        "name": "matching default expression repairs table definition",
        "observed": {
          "error": true,
          "status": "IDLE",
          "value": 1
        },
        "passed": true
      }
    ],
    "case_manifest": {
      "id": "manifest.42804",
      "kind": "local_artifact",
      "path": "verify/cases/42804/cases.json",
      "sha256": "05413a4b7a2096ddd8755efc43e853413838383fc32d89f73c769917ebada6f9",
      "source_role": "case_manifest"
    },
    "cases": [
      "default_type_mismatch"
    ],
    "cleanup": {
      "errors": [],
      "passed": true
    },
    "environment": {
      "TimeZone": "Asia/Shanghai",
      "backend_pid": 29825,
      "binary": {
        "bindir": "/opt/homebrew/Cellar/postgresql@18/18.6/bin",
        "pg_config": "/opt/homebrew/bin/pg_config",
        "pg_config_version": "PostgreSQL 18.6 (Homebrew)",
        "postgres": "/opt/homebrew/Cellar/postgresql@18/18.6/bin/postgres"
      },
      "connection_scope": "runner-owned localhost port",
      "current_user": "runner",
      "docker": {},
      "lc_messages": "C",
      "libpq_version": "18.6",
      "locale": "C.UTF-8",
      "log_destination": "csvlog,jsonlog",
      "log_error_verbosity": "verbose",
      "log_min_error_statement": "error",
      "log_min_messages": "error",
      "logging_collector": "on",
      "machine": "arm64",
      "max_connections": "100",
      "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_encoding": "UTF8",
      "server_version": "18.6 (Homebrew)",
      "server_version_num": "180006",
      "target_kind": "latest",
      "wal_level": "logical"
    },
    "id": "runtime.syntax2-42804-latest.latest",
    "observed": {
      "connection_autocommit": true,
      "diagnostic": {
        "column_name": null,
        "constraint_name": null,
        "context": null,
        "datatype_name": null,
        "exception_type": "DatatypeMismatch",
        "internal_position": null,
        "internal_query": null,
        "message_detail": null,
        "message_hint": "You will need to rewrite or cast the expression.",
        "message_primary": "column \"value\" is of type integer but default expression is of type text",
        "schema_name": null,
        "severity": "ERROR",
        "severity_nonlocalized": "ERROR",
        "source_file": "heap.c",
        "source_function": "cookDefault",
        "source_line": "3420",
        "sqlstate": "42804",
        "statement_position": null,
        "table_name": null,
        "text": "column \"value\" is of type integer but default expression is of type text\nHINT:  You will need to rewrite or cast the expression."
      },
      "failed_status": "IDLE",
      "repair_status": "IDLE",
      "repair_value": 1
    },
    "raw": "verify/results/syntax2-42804-latest/latest/raw.jsonl",
    "raw_sha256": "80e9dbafb1a45c96b8a6e104b704a9536fef7c7e93e208b7e47663df03846c12",
    "run_id": "syntax2-42804-latest",
    "server_version": "18.6 (Homebrew)",
    "server_version_num": 180006,
    "snippet_registry": {
      "id": "snippet-registry.42804",
      "kind": "local_artifact",
      "path": "verify/cases/42804/snippets.json",
      "sha256": "614d9ba401e016a67127a3daf08dd1b70139fa54ef26037c32ad668a5c40873b",
      "source_role": "snippet_registry"
    },
    "status": "passed",
    "summary": "verify/results/syntax2-42804-latest/latest/summary.json",
    "summary_sha256": "fcb8c1ffc71d0018c42bdc6cae3aa4cfcbf7b0783a058c899ff5c7e1d3f7ca6a",
    "target": "latest",
    "target_stop": {
      "argv": [
        "/opt/homebrew/Cellar/postgresql@18/18.6/bin/pg_ctl",
        "-D",
        "/Users/vonng/pgcenter/err-code/.cache/runtime/syntax2-42804-latest/latest/data",
        "-m",
        "fast",
        "-w",
        "stop"
      ],
      "elapsed_seconds": 0.116,
      "returncode": 0,
      "stderr": "",
      "stdout": "waiting for server to shut down.... done\nserver stopped\n"
    }
  },
  "run_id": "syntax2-42804-latest",
  "runtime_id": "runtime.syntax2-42804-latest.latest",
  "server_version": "18.6 (Homebrew)",
  "status": "passed",
  "target": "latest"
}
runtimes · runtime.syntax2-42804-pg10.pg10 · 10.21 (Debian 10.21-1.pgdg90+1) · passed
{
  "cases": [
    "default_type_mismatch"
  ],
  "limits": "",
  "position": 1,
  "raw": {
    "assertions": [
      {
        "expected": "42804",
        "name": "42804 SQLSTATE",
        "observed": "42804",
        "passed": true
      },
      {
        "expected": "ERROR",
        "name": "42804 ERROR severity",
        "observed": "ERROR",
        "passed": true
      },
      {
        "expected": "column \"value\" is of type integer but default expression is of type text",
        "name": "42804 primary diagnostic",
        "observed": "column \"value\" is of type integer but default expression is of type text",
        "passed": true
      },
      {
        "expected": "You will need to rewrite or cast the expression.",
        "name": "datatype mismatch preserves the cast/rewrite hint",
        "observed": "You will need to rewrite or cast the expression.",
        "passed": true
      },
      {
        "expected": "IDLE",
        "name": "datatype mismatch leaves autocommit session usable",
        "observed": "IDLE",
        "passed": true
      },
      {
        "expected": {
          "status": "IDLE",
          "value": 1
        },
        "name": "matching default expression repairs table definition",
        "observed": {
          "error": true,
          "status": "IDLE",
          "value": 1
        },
        "passed": true
      }
    ],
    "case_manifest": {
      "id": "manifest.42804",
      "kind": "local_artifact",
      "path": "verify/cases/42804/cases.json",
      "sha256": "05413a4b7a2096ddd8755efc43e853413838383fc32d89f73c769917ebada6f9",
      "source_role": "case_manifest"
    },
    "cases": [
      "default_type_mismatch"
    ],
    "cleanup": {
      "errors": [],
      "passed": true
    },
    "environment": {
      "TimeZone": "Etc/UTC",
      "backend_pid": 79,
      "binary": {},
      "connection_scope": "runner-owned localhost port",
      "current_user": "postgres",
      "docker": {
        "architecture": "arm64",
        "command": "/usr/local/bin/docker",
        "digest": "sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc",
        "id": "sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc",
        "image": "postgres:10",
        "image_created": "2022-06-23T09:11:18.374607054Z",
        "image_ref": "postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc",
        "log_destination": "csvlog",
        "os": "linux",
        "repo_digests": [
          "postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc"
        ]
      },
      "lc_messages": "en_US.utf8",
      "libpq_version": "18.6",
      "locale": "C.UTF-8",
      "log_destination": "csvlog",
      "log_error_verbosity": "verbose",
      "log_min_error_statement": "error",
      "log_min_messages": "error",
      "logging_collector": "on",
      "machine": "arm64",
      "max_connections": "100",
      "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_encoding": "UTF8",
      "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
      "server_version_num": "100021",
      "target_kind": "pg10",
      "wal_level": "logical"
    },
    "id": "runtime.syntax2-42804-pg10.pg10",
    "observed": {
      "connection_autocommit": true,
      "diagnostic": {
        "column_name": null,
        "constraint_name": null,
        "context": null,
        "datatype_name": null,
        "exception_type": "DatatypeMismatch",
        "internal_position": null,
        "internal_query": null,
        "message_detail": null,
        "message_hint": "You will need to rewrite or cast the expression.",
        "message_primary": "column \"value\" is of type integer but default expression is of type text",
        "schema_name": null,
        "severity": "ERROR",
        "severity_nonlocalized": "ERROR",
        "source_file": "heap.c",
        "source_function": "cookDefault",
        "source_line": "2686",
        "sqlstate": "42804",
        "statement_position": null,
        "table_name": null,
        "text": "column \"value\" is of type integer but default expression is of type text\nHINT:  You will need to rewrite or cast the expression."
      },
      "failed_status": "IDLE",
      "repair_status": "IDLE",
      "repair_value": 1
    },
    "raw": "verify/results/syntax2-42804-pg10/pg10/raw.jsonl",
    "raw_sha256": "a04f19ae59de9d4656844f1fbebe08820ab41fb6a6f0ed512f6ea3a712410d47",
    "run_id": "syntax2-42804-pg10",
    "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
    "server_version_num": 100021,
    "snippet_registry": {
      "id": "snippet-registry.42804",
      "kind": "local_artifact",
      "path": "verify/cases/42804/snippets.json",
      "sha256": "614d9ba401e016a67127a3daf08dd1b70139fa54ef26037c32ad668a5c40873b",
      "source_role": "snippet_registry"
    },
    "status": "passed",
    "summary": "verify/results/syntax2-42804-pg10/pg10/summary.json",
    "summary_sha256": "43c38fc6ac8845bc5b72d1897be9d20f82528f70a495a25debdab32152c90783",
    "target": "pg10",
    "target_stop": {
      "cleanup": {
        "argv": [
          "/usr/local/bin/docker",
          "rm",
          "-f",
          "-v",
          "sqlstate42804_syntax242804pg10_pg10"
        ],
        "elapsed_seconds": 0.278,
        "returncode": 0,
        "stderr": "",
        "stdout": "sqlstate42804_syntax242804pg10_pg10\n"
      },
      "inspect": {
        "argv": [
          "/usr/local/bin/docker",
          "inspect",
          "sqlstate42804_syntax242804pg10_pg10"
        ],
        "elapsed_seconds": 0.018,
        "returncode": 0,
        "stderr": "",
        "stdout": "[\n    {\n        \"Id\": \"73b22bf7cbe8fb5a3c464fa122686204007ea766c0cf473ba4939c55e440ee1f\",\n        \"Created\": \"2026-09-09T16:40:13.189494763Z\",\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\": 62865,\n            \"ExitCode\": 0,\n            \"Error\": \"\",\n            \"StartedAt\": \"2026-09-09T16:40:13.265462847Z\",\n            \"FinishedAt\": \"0001-01-01T00:00:00Z\"\n        },\n        \"Image\": \"sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc\",\n        \"ResolvConfPath\": \"/var/lib/docker/containers/73b22bf7cbe8fb5a3c464fa122686204007ea766c0cf473ba4939c55e440ee1f/resolv.conf\",\n        \"HostnamePath\": \"/var/lib/docker/containers/73b22bf7cbe8fb5a3c464fa122686204007ea766c0cf473ba4939c55e440ee1f/hostname\",\n        \"HostsPath\": \"/var/lib/docker/containers/73b22bf7cbe8fb5a3c464fa122686204007ea766c0cf473ba4939c55e440ee1f/hosts\",\n        \"LogPath\": \"/var/lib/docker/containers/73b22bf7cbe8fb5a3c464fa122686204007ea766c0cf473ba4939c55e440ee1f/73b22bf7cbe8fb5a3c464fa122686204007ea766c0cf473ba4939c55e440ee1f-json.log\",\n        \"Name\": \"/sqlstate42804_syntax242804pg10_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\": \"48a9d8a320a5203fd1ba518ad09474d1a122f81cdad218fd02cd4c2357759339\",\n                \"Source\": \"/var/lib/docker/volumes/48a9d8a320a5203fd1ba518ad09474d1a122f81cdad218fd02cd4c2357759339/_data\",\n                \"Destination\": \"/var/lib/postgresql/data\",\n                \"Driver\": \"local\",\n                \"Mode\": \"\",\n                \"RW\": true,\n                \"Propagation\": \"\"\n            }\n        ],\n        \"Config\": {\n            \"Hostname\": \"73b22bf7cbe8\",\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\": \"e87c5c9660e1ccc2feb37fae2bdee16faac990a4a75cb2eaf46570e7c35b6f2b\",\n            \"SandboxKey\": \"/var/run/docker/netns/e87c5c9660e1\",\n            \"Ports\": {\n                \"5432/tcp\": [\n                    {\n                        \"HostIp\": \"127.0.0.1\",\n                        \"HostPort\": \"54135\"\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\": \"01fdc935e8823db6ac6b2ec88f8c31e06e2101b0bf0cd7acb9e3221a604129bc\",\n                    \"Gateway\": \"172.17.0.1\",\n                    \"IPAddress\": \"172.17.0.53\",\n                    \"MacAddress\": \"4a:47:4d:fe:6b:b8\",\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"
      }
    }
  },
  "run_id": "syntax2-42804-pg10",
  "runtime_id": "runtime.syntax2-42804-pg10.pg10",
  "server_version": "10.21 (Debian 10.21-1.pgdg90+1)",
  "status": "passed",
  "target": "pg10"
}
sources · src.errcodes.REL_18_6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/utils/errcodes.txt",
  "position": 0,
  "sha256": "6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba",
  "source_id": "src.errcodes.REL_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": "",
  "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": "",
  "url": ""
}
sources · src.datatype-default.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/catalog/heap.c",
  "position": 3,
  "sha256": "e720ee58279590793edd0985b3c910970ef56e7361b8ef92e245370587e02a0e",
  "source_id": "src.datatype-default.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/catalog/heap.c#L3413-L3420"
}
sources · src.datatype-default.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/catalog/heap.c",
  "position": 4,
  "sha256": "285e1e2f8024acb58497735bcbd8e605e7cfdd224e442becdee6a5b0e7ac7cf6",
  "source_id": "src.datatype-default.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/catalog/heap.c#L2679-L2686"
}
sources · src.assignment-target.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/parser/parse_target.c",
  "position": 5,
  "sha256": "4f0cda351acc3e2854bf55514e69cf8b7de6ad82e1535045e4523581ca0d943c",
  "source_id": "src.assignment-target.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_target.c#L575-L596"
}
sources · src.assignment-target.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/parser/parse_target.c",
  "position": 6,
  "sha256": "808bfadd7717d711bc71eb85b7ecd343c742ccc8f6f3087164ed20da098b6d7d",
  "source_id": "src.assignment-target.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/parser/parse_target.c#L570-L596"
}
sources · src.common-type.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/parser/parse_coerce.c",
  "position": 7,
  "sha256": "6ac3ddab06edff28e9a694c64fb7f559315cf488bfa4392bc14c24e559f6bd2e",
  "source_id": "src.common-type.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_coerce.c#L1327-L1425"
}
sources · src.common-type.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/parser/parse_coerce.c",
  "position": 8,
  "sha256": "ed778c872fe4f2b8742828795566c3eaa24e7af3ce747fbf844c374d673593d3",
  "source_id": "src.common-type.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/parser/parse_coerce.c#L1217-L1311"
}
sources · src.common-coerce.18.6
{
  "commit": "724edf9bde9d356724ad384a2e196edc3c9f80f7",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/parser/parse_coerce.c",
  "position": 9,
  "sha256": "6ac3ddab06edff28e9a694c64fb7f559315cf488bfa4392bc14c24e559f6bd2e",
  "source_id": "src.common-coerce.18.6",
  "tag": "REL_18_6",
  "url": "https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/parser/parse_coerce.c#L1564-L1593"
}
sources · src.common-coerce.10.23
{
  "commit": "02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4",
  "docs_url": "",
  "kind": "upstream_source",
  "location": "",
  "path": "src/backend/parser/parse_coerce.c",
  "position": 10,
  "sha256": "ed778c872fe4f2b8742828795566c3eaa24e7af3ce747fbf844c374d673593d3",
  "source_id": "src.common-coerce.10.23",
  "tag": "REL_10_23",
  "url": "https://github.com/postgres/postgres/blob/02991e79f8f58bc208f05dcc8af0c62dbe0a6ea4/src/backend/parser/parse_coerce.c#L1349-L1378"
}
sources · manifest.42804
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "verify/cases/42804/cases.json",
  "position": 11,
  "sha256": "05413a4b7a2096ddd8755efc43e853413838383fc32d89f73c769917ebada6f9",
  "source_id": "manifest.42804",
  "tag": "",
  "url": ""
}
sources · snippet-registry.42804
{
  "commit": "",
  "docs_url": "",
  "kind": "local_artifact",
  "location": "",
  "path": "verify/cases/42804/snippets.json",
  "position": 12,
  "sha256": "614d9ba401e016a67127a3daf08dd1b70139fa54ef26037c32ad668a5c40873b",
  "source_id": "snippet-registry.42804",
  "tag": "",
  "url": ""
}

来源引用

完整定义与证据 JSON

定义来源

center · PostgreSQL 18 · english-manuals:388f3bb9eb2d1a86bca3a334072151c2e77e54457368d149b589686e2da98bcf

正文语言: zh-Hans · english-manuals:388f3bb9eb2d1a86bca3a334072151c2e77e54457368d149b589686e2da98bcf