{"Entry":{"collection":"sqlstate","key":"23505","name":"23505","aliases":[],"metadata":{"aliases":[],"case_count":13,"class_code":"23","condition_name":"unique_violation","condition_names":["unique_violation"],"content_hash":"5bbfc811ad9385a103fe75e9f82825ce0c36c6484e707497b033bea4f73e8149","depth":"full","editorial_review":"reviewed","evidence_tier":"observed_runtime","imported_at":"2026-09-30T17:45:27.204963+08:00","introduced":null,"known_present_by":"7.4","macros":["ERRCODE_UNIQUE_VIOLATION"],"name_zh":"唯一性冲突","present_in":["9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19"],"preview_in":["19"],"primary_macro":"ERRCODE_UNIQUE_VIOLATION","removed":null,"runtime_verification":"passed","severity_classes":["E"],"snippet_count":7,"source_rev":"english-manuals:80d4516037e6dac2ecaca604550622754952d6d2209097d343ab740fddb6091e","sqlstate":"23505","status":"active","summary_zh":"行或索引违反唯一约束，常见于重复键插入。"}},"Definition":{"Collection":"sqlstate","Key":"23505","SourceDatabase":"center","Version":"18","SourceTable":"sqlstate","SourceKey":"23505","SourceRevision":"english-manuals:80d4516037e6dac2ecaca604550622754952d6d2209097d343ab740fddb6091e","Facts":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"56dacf78e618ff0fd8c533e05db597b80d7ebbad7f8e512a888217d0640aa328","slug":"18"},"lang":"en","sqlstate":"23505"},"ManualEvidence":{"doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"56dacf78e618ff0fd8c533e05db597b80d7ebbad7f8e512a888217d0640aa328","slug":"18"}},"MeasuredEvidence":{}},"Text":{"Collection":"sqlstate","Key":"23505","SourceDatabase":"center","Version":"","Locale":"zh-Hans","Title":"23505 — unique_violation：唯一性冲突","Summary":"行或索引违反唯一约束，常见于重复键插入。","BodyHTML":"\u003ch2\u003e速览 {#at-a-glance}\u003c/h2\u003e\n\u003cp\u003e\u003ccode\u003e23505\u003c/code\u003e 是 PostgreSQL 的 \u003ccode\u003eunique_violation\u003c/code\u003e 条件。当行、索引构建或逻辑应用发现某个值不能与正在执行的唯一性约束共存时，就会产生这个状态码。\u003c/p\u003e\n\u003cp\u003e第一步应保存完整的 ErrorResponse 以及失败的语句。最有用的字段是 \u003ccode\u003eC\u003c/code\u003e（SQLSTATE）、\u003ccode\u003eM\u003c/code\u003e（主消息）、\u003ccode\u003eD\u003c/code\u003e（detail），以及在服务器提供时的 \u003ccode\u003es\u003c/code\u003e（schema）、\u003ccode\u003et\u003c/code\u003e（table）和 \u003ccode\u003en\u003c/code\u003e（constraint 或 index）。在 psycopg 中，这些字段位于 \u003ccode\u003eexc.sqlstate\u003c/code\u003e 和 \u003ccode\u003eexc.diag\u003c/code\u003e。对象字段属于线协议；它们不是 CSV 日志的标准列名，也不是 JSON 日志的标准键名。\u003c/p\u003e\n\u003cp\u003e恢复方式取决于错误发生的位置：\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e自动提交语句失败，但连接可以继续接收下一条命令。\u003c/li\u003e\n\u003cli\u003e显式事务中的语句失败后，事务进入中止状态。必须回滚整个事务，或回滚到保存点，然后才能继续发语句；否则 PostgreSQL 会返回 \u003ccode\u003e25P02\u003c/code\u003e。\u003c/li\u003e\n\u003cli\u003e延迟唯一约束可以暂时接受重复行，并在 \u003ccode\u003eCOMMIT\u003c/code\u003e 时报告 \u003ccode\u003e23505\u003c/code\u003e。\u003c/li\u003e\n\u003cli\u003ePL/pgSQL 的 \u003ccode\u003eEXCEPTION\u003c/code\u003e 块可以在子事务中捕获该冲突，但处理器必须足够窄，能够确认究竟是哪一个操作失败。\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e当前选定的公开运行记录按案例和目标覆盖 PostgreSQL 18.6 的 12 个独立通过案例，以及 PostgreSQL 10.21 的 11 个通过案例；\u003ccode\u003eNULLS NOT DISTINCT\u003c/code\u003e 在 PG10 标为不适用。完整运行仍为未被替代案例的来源；定向最终记录分别选择 DML 诊断、精确的 \u003ccode\u003elog_fields\u003c/code\u003e 关联、registry 片段和手动事务边界，不重复或覆盖这些案例。另有 PG14.24/PG15.19 的版本边界对照：PG14 的显式 \u003ccode\u003eUNIQUE NULLS NOT DISTINCT\u003c/code\u003e 只得到不支持语法的 \u003ccode\u003e42601\u003c/code\u003e，PG15 则在第二个 NULL 上实际得到 \u003ccode\u003e23505\u003c/code\u003e；该对照不计入上述基础数量。选定 run ID 和结构化观察保存在\u003ca href=\"#sources\" rel=\"nofollow\"\u003e公开证据 JSON\u003c/a\u003e中；被替代的 summary 与原始 JSONL 仅保留为本地审计数据。\u003c/p\u003e\n\u003cp\u003e上面的生成锁定快照表示目录定义文件的版本覆盖。本页的可执行兼容性目标是 PostgreSQL 18.6 和 10.21；目录条目不声称 23505 是 PostgreSQL 10 才引入的。\u003c/p\u003e\n\u003ch2\u003e含义与触发路径 {#meaning}\u003c/h2\u003e\n\u003cp\u003eSQLSTATE 目录把 \u003ccode\u003e23505\u003c/code\u003e 放在 Class 23 \u003ccode\u003eintegrity_constraint_violation\u003c/code\u003e 下，条件名为 \u003ccode\u003eunique_violation\u003c/code\u003e。在普通 btree 路径中，PostgreSQL 检查索引项；如果冲突的已提交键或并发插入键不符合索引语义允许的条件，就会报告错误。主键也是唯一索引，因此重复主键值同样使用这个状态码。\u003c/p\u003e\n\u003cp\u003e同一个 SQLSTATE 可以描述多种机制：\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003cstrong\u003e违反 DML 唯一约束或索引。\u003c/strong\u003e \u003ccode\u003eINSERT\u003c/code\u003e，以及改变键值的 \u003ccode\u003eUPDATE\u003c/code\u003e，都可能与唯一索引保护的已有行冲突。普通消息模板是 \u003ccode\u003eduplicate key value violates unique constraint \u0026#34;...\u0026#34;\u003c/code\u003e，可选的 detail 是 \u003ccode\u003eKey (...)=(...) already exists.\u003c/code\u003e。\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e构建唯一索引。\u003c/strong\u003e 在已有重复行的表上构建唯一索引时使用另一套模板：\u003ccode\u003ecould not create unique index \u0026#34;...\u0026#34;\u003c/code\u003e，detail 为 \u003ccode\u003eKey (...)=(...) is duplicated.\u003c/code\u003e。这是索引构建失败，不是普通行插入消息。\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e延迟约束。\u003c/strong\u003e 使用 \u003ccode\u003eDEFERRABLE INITIALLY DEFERRED\u003c/code\u003e 时，重复值可以留在事务中，直到提交时检查约束。因此错误对应 \u003ccode\u003eCOMMIT\u003c/code\u003e，失败的顶层提交会回滚该事务。\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e逻辑复制应用。\u003c/strong\u003e PostgreSQL 18 会把应用冲突分类为 \u003ccode\u003einsert_exists\u003c/code\u003e 等；冲突报告器仍将相关的 insert、update 和 multiple-unique 路径映射到 \u003ccode\u003e23505\u003c/code\u003e。其消息形态和服务器日志上下文与客户端 btree 插入不同。本页有该路径的源码和文档证据，但当前运行批次没有建立 publisher/subscriber 拓扑。\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003e状态码说明了条件所属的类别，但不能单独说明冲突是持久的业务重复、键选择竞态，还是维护操作失败。需要结合语句、schema、约束定义、事务上下文和并发活动作出判断。\u003c/p\u003e\n\u003cp\u003e下面的 SQL 代码块是与指定案例同一操作的说明性片段。权威可执行来源是 \u003ccode\u003escripts/verify_cases.py\u003c/code\u003e 和 \u003ccode\u003everify/cases/23505/cases.json\u003c/code\u003e；片段只省略临时 schema 命名和清理，并标明案例 ID，不构成第二套可运行案例定义。\u003c/p\u003e\n\u003ch2\u003e报文与诊断字段 {#messages}\u003c/h2\u003e\n\u003cp\u003e在 PostgreSQL 18.6 源码的 \u003ccode\u003enbtinsert.c\u003c/code\u003e 普通路径中，服务器调用 \u003ccode\u003eBuildIndexValueDescription\u003c/code\u003e，报告唯一性错误，并附加表和约束身份。一次真实运行记录如下：\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eSQLSTATE: 23505\nseverity: ERROR\nmessage_primary: duplicate key value violates unique constraint \u0026#34;users_email_key\u0026#34;\nmessage_detail: Key (email)=(a@example.test) already exists.\nschema_name: c23505_dml_unique_conflict\ntable_name: users\nconstraint_name: users_email_key\nsource: nbtinsert.c / _bt_check_unique\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003edetail 不是必然存在的。如果调用者没有权限查看相关列，行级安全策略阻止描述，或者索引是表达式索引，PostgreSQL 可能省略键值。相同运行中的 INSERT-only 角色仍得到 SQLSTATE 和对象身份，但没有 \u003ccode\u003emessage_detail\u003c/code\u003e。\u003c/p\u003e\n\u003cp\u003e协议字段定义在 \u003ca href=\"/docs/18/protocol-error-fields.html\" rel=\"nofollow\"\u003eError and Notice Message Fields\u003c/a\u003e 中。应从驱动异常读取这些字段，不要从日志解析器推断。18.6 的日志配置文档描述了 CSV 的 \u003ccode\u003esql_state_code\u003c/code\u003e、\u003ccode\u003emessage\u003c/code\u003e、\u003ccode\u003edetail\u003c/code\u003e 等字段，以及 JSON 的 \u003ccode\u003estate_code\u003c/code\u003e、\u003ccode\u003emessage\u003c/code\u003e、\u003ccode\u003edetail\u003c/code\u003e 等键；两种格式都没有把协议中的 \u003ccode\u003econstraint_name\u003c/code\u003e 定义为标准日志字段。定向 \u003ccode\u003elog_fields\u003c/code\u003e run 按同一后端 PID、模式/表、约束、主消息和 detail 将 collector 记录与驱动诊断逐项匹配：PostgreSQL 18.6 同时得到 CSV 和 JSON，PostgreSQL 10.21 得到 CSV。\u003c/p\u003e\n\u003cp\u003e索引构建报文明确不同：\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eSQLSTATE: 23505\nmessage_primary: could not create unique index \u0026#34;idx_concurrent\u0026#34;\nmessage_detail: Key (email)=(dup) is duplicated.\nsource: tuplesortvariants.c / comparetup_index_btree_tiebreak\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e不要只解析英文报文来分类错误。应先按 SQLSTATE 分支，再使用结构化字段和操作上下文。消息文本可能随本地化变化，而五字符 SQLSTATE 是稳定的线协议值。\u003c/p\u003e\n\u003ch2\u003e诊断 {#diagnosis}\u003c/h2\u003e\n\u003cp\u003e记录失败语句、SQLSTATE、主消息、detail、hint、schema/table/constraint 字段、服务器版本和事务状态。驱动应保留原始异常；通用 ORM 错误字符串可能丢掉定位冲突对象所需的字段。\u003c/p\u003e\n\u003cp\u003e针对某个表，在修改数据前同时检查约束和索引。下面两条查询就是运行器使用的 \u003ccode\u003ediagnostic_catalog_queries\u003c/code\u003e；隔离运行会对其 \u003ccode\u003eaccounts\u003c/code\u003e 表实际执行：\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eSELECT conname, contype, condeferrable, condeferred,\n       pg_get_constraintdef(oid)\nFROM pg_constraint\nWHERE conrelid = \u0026#39;accounts\u0026#39;::regclass;\n\nSELECT indexrelid::regclass AS index_name,\n       indisunique, indisvalid, indisready, indislive,\n       pg_get_indexdef(indexrelid)\nFROM pg_index\nWHERE indrelid = \u0026#39;accounts\u0026#39;::regclass;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e对于普通 DML 错误，将尝试写入的键与命名约束保护的行进行比较。检查该表上的每一项唯一性约束；语句指定了一个冲突目标，也仍可能违反另一个唯一约束。对于索引构建错误，在重试前找出重复键，并在并发构建失败后检查 \u003ccode\u003epg_index\u003c/code\u003e。\u003c/p\u003e\n\u003cp\u003e运行案例 \u003ccode\u003econcurrent_unique_conflict\u003c/code\u003e 使用两个会话和一个观察会话。会话 A 持有未提交的 \u003ccode\u003etoken=\u0026#39;raced\u0026#39;\u003c/code\u003e；在 A 提交前，观察会话看到 B 的语句 \u003ccode\u003ewait_event_type=Lock\u003c/code\u003e、\u003ccode\u003ewait_event=transactionid\u003c/code\u003e。A 提交后，B 收到 \u003ccode\u003e23505\u003c/code\u003e，并在回滚前处于 \u003ccode\u003eINERROR\u003c/code\u003e。这个同步条件证明了事件顺序；固定 sleep 不能提供同等证据。\u003c/p\u003e\n\u003ch2\u003e处置与修复 {#response}\u003c/h2\u003e\n\u003ch3\u003e先恢复事务（案例：\u003ccode\u003eexplicit_tx_abort_recovery\u003c/code\u003e、\u003ccode\u003esavepoint_recovery\u003c/code\u003e）\u003c/h3\u003e\n\u003cp\u003e启用自动提交时，失败操作已经结束，运行案例中的连接状态为 \u003ccode\u003eIDLE\u003c/code\u003e。应用应先决定如何处理输入，再发起下一条命令。\u003c/p\u003e\n\u003cp\u003e在显式事务中，第一次失败后不要继续使用该连接，先处理失败事务：\u003c/p\u003e\n\u003cp\u003e下面的 \u003ccode\u003eINSERT INTO items VALUES (3, \u0026#39;seed\u0026#39;)\u003c/code\u003e 是真实的重复键触发；后面的 \u003ccode\u003eROLLBACK\u003c/code\u003e 是必须的恢复操作。\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE items(id integer PRIMARY KEY, note text UNIQUE NOT NULL);\nINSERT INTO items VALUES (1, \u0026#39;seed\u0026#39;);\nBEGIN;\nINSERT INTO items VALUES (2, \u0026#39;outer\u0026#39;);\nINSERT INTO items VALUES (3, \u0026#39;seed\u0026#39;);\nROLLBACK;\nBEGIN;\nINSERT INTO items VALUES (2, \u0026#39;after rollback\u0026#39;);\nCOMMIT;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e如果只有一小段工作是可选的，可以使用保存点保留外层工作：\u003c/p\u003e\n\u003cp\u003e保存点之后的插入复用了已经准备好的唯一值，因此是真实的 \u003ccode\u003e23505\u003c/code\u003e 触发；\u003ccode\u003eROLLBACK TO SAVEPOINT\u003c/code\u003e 只撤销这段失败的子事务。\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE items(id integer PRIMARY KEY, note text UNIQUE NOT NULL);\nINSERT INTO items VALUES (1, \u0026#39;seed\u0026#39;);\nBEGIN;\nINSERT INTO items VALUES (2, \u0026#39;outer\u0026#39;);\nSAVEPOINT unique_case;\nINSERT INTO items VALUES (3, \u0026#39;seed\u0026#39;);\n-- 事务失败时，这条语句预期返回 25P02。\nSELECT count(*) FROM items;\nROLLBACK TO SAVEPOINT unique_case;\nINSERT INTO items VALUES (3, \u0026#39;after savepoint\u0026#39;);\nRELEASE SAVEPOINT unique_case;\nCOMMIT;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e运行器在回滚前执行 \u003ccode\u003eSELECT\u003c/code\u003e 时观察到 \u003ccode\u003e25P02\u003c/code\u003e，在 \u003ccode\u003eROLLBACK TO SAVEPOINT\u003c/code\u003e 后观察到 \u003ccode\u003eINTRANS\u003c/code\u003e。普通 \u003ccode\u003eROLLBACK\u003c/code\u003e 会让显式事务回到 \u003ccode\u003eIDLE\u003c/code\u003e；\u003ccode\u003eROLLBACK TO\u003c/code\u003e 会保留保存点之前的工作。\u003c/p\u003e\n\u003cp\u003e延迟约束会改变错误发生的阶段（案例：\u003ccode\u003edeferred_commit_conflict\u003c/code\u003e）。在真实案例中，两次重复插入在连接处于 \u003ccode\u003eINTRANS\u003c/code\u003e 时都成功；随后 \u003ccode\u003eCOMMIT\u003c/code\u003e 报 \u003ccode\u003e23505\u003c/code\u003e，连接回到 \u003ccode\u003eIDLE\u003c/code\u003e，失败顶层事务产生的行数为零。应在提交前修复键，或回滚并重试整个工作单元。\u003c/p\u003e\n\u003cp\u003ePL/pgSQL 可以在异常块中处理自然产生的唯一性冲突（案例：\u003ccode\u003eplpgsql_exception_recovery\u003c/code\u003e）：\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE items(id integer PRIMARY KEY, note text);\nINSERT INTO items(id, note) VALUES (1, \u0026#39;seed\u0026#39;);\n\nCREATE FUNCTION try_insert(wanted integer) RETURNS text\nLANGUAGE plpgsql AS $$\nDECLARE returned_state text;\nBEGIN\n    INSERT INTO items(id, note) VALUES (wanted, \u0026#39;body\u0026#39;);\n    RETURN \u0026#39;inserted\u0026#39;;\nEXCEPTION WHEN unique_violation THEN\n    GET STACKED DIAGNOSTICS returned_state = RETURNED_SQLSTATE;\n    INSERT INTO items(id, note) VALUES (wanted + 1, \u0026#39;handler\u0026#39;);\n    RETURN returned_state;\nEND\n$$;\n\nSELECT try_insert(1);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e受保护的代码块具有子事务行为。发生错误时，该代码块内部已经写入的持久化改动会在处理器运行前回滚；进入代码块之前的改动仍会保留。异常块应保持窄范围：如果其中有多条可能违反不同唯一约束的语句，那么捕获到 \u003ccode\u003eunique_violation\u003c/code\u003e 本身不能证明是哪一条操作造成了它。PostgreSQL 的 PL/pgSQL 文档也针对通用 upsert 处理器提醒了这一点。\u003c/p\u003e\n\u003ch3\u003e选择符合业务语义的操作（案例：\u003ccode\u003eon_conflict_target_scope\u003c/code\u003e）\u003c/h3\u003e\n\u003cp\u003e\u003ccode\u003eON CONFLICT\u003c/code\u003e 用于表达明确的冲突策略，不是隐藏所有重复行的通用指令。冲突目标决定 arbiter。在运行案例中，已有行占用了 \u003ccode\u003ephone=\u0026#39;phone-1\u0026#39;\u003c/code\u003e：\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eCREATE TABLE accounts(\n    id integer PRIMARY KEY,\n    email text NOT NULL,\n    phone text NOT NULL,\n    CONSTRAINT accounts_email_uq UNIQUE (email),\n    CONSTRAINT accounts_phone_uq UNIQUE (phone)\n);\nINSERT INTO accounts VALUES (1, \u0026#39;existing@example.test\u0026#39;, \u0026#39;phone-1\u0026#39;);\n\nINSERT INTO accounts(id,email,phone)\nVALUES (2, \u0026#39;existing@example.test\u0026#39;, \u0026#39;phone-2\u0026#39;)\nON CONFLICT (email) DO NOTHING;\n\n-- 只处理 email 冲突。仅 phone 冲突时仍会产生 23505。\nINSERT INTO accounts(id,email,phone)\nVALUES (3, \u0026#39;new@example.test\u0026#39;, \u0026#39;phone-1\u0026#39;)\nON CONFLICT (email) DO NOTHING;\n\n-- 省略 target 时，DO NOTHING 覆盖任一可用 arbiter 的冲突。\nINSERT INTO accounts(id,email,phone)\nVALUES (4, \u0026#39;third@example.test\u0026#39;, \u0026#39;phone-1\u0026#39;)\nON CONFLICT DO NOTHING;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e对于 \u003ccode\u003eDO UPDATE\u003c/code\u003e，应确保更新是确定性的，并检查其业务结果。对于幂等键，应将传入请求的相关身份和参数与已存请求比较，再核对已有业务结果，然后才能返回“已经处理”。仅发生幂等键碰撞，不能证明先前请求等价。\u003c/p\u003e\n\u003ch3\u003e谨慎修复序列（案例：\u003ccode\u003esequence_lag_repair\u003c/code\u003e）\u003c/h3\u003e\n\u003cp\u003e手动指定键可能使序列落后于表。受控运行案例使用了非默认序列：\u003c/p\u003e\n\u003cp\u003e下面第二个使用 \u003ccode\u003enextval\u003c/code\u003e 的插入是真实的重复键触发；\u003ccode\u003esetval\u003c/code\u003e 后又执行了一次真实插入，以验证修复后的下一个值。\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003eCREATE SEQUENCE ids_seq START WITH 100 INCREMENT BY 7 MINVALUE 100 MAXVALUE 100000;\nCREATE TABLE items(id integer PRIMARY KEY, note text);\nINSERT INTO items(id,note) VALUES (100, \u0026#39;explicit\u0026#39;);\nINSERT INTO items(id,note) VALUES (nextval(\u0026#39;ids_seq\u0026#39;), \u0026#39;generated\u0026#39;);\nSELECT setval(\u0026#39;ids_seq\u0026#39;, (SELECT max(id) FROM items), true);\nINSERT INTO items(id,note) VALUES (nextval(\u0026#39;ids_seq\u0026#39;), \u0026#39;after repair\u0026#39;);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e受控 \u003ccode\u003esetval\u003c/code\u003e 后下一值为 107。这种修复有明确前提：暂停写入者，确认序列身份和所有关系，空表不能传入无效值，并检查 increment、边界、cache 和 \u003ccode\u003eis_called\u003c/code\u003e。\u003ccode\u003esetval\u003c/code\u003e 不是通用的并发修复；序列变更也不会像普通表写入那样回滚。\u003c/p\u003e\n\u003ch3\u003e只有在操作可重试时才重试\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"/docs/18/mvcc-serialization-failure-handling.html\" rel=\"nofollow\"\u003e序列化失败处理文档\u003c/a\u003e 说明了某些并发选择键的场景可能以 \u003ccode\u003e23505\u003c/code\u003e 呈现。应用确认属于这种语义后，应重试完整事务（包括选择键的逻辑），并配合有界退避和幂等策略。不要盲目重试：用户明确请求的重复可能是永久条件，反复尝试也可能得到同一冲突。\u003c/p\u003e\n\u003cp\u003e双会话案例证明了锁顺序建立后会出现冲突，但运行器没有声称所有相同状态码的业务操作都可以安全重试。\u003c/p\u003e\n\u003ch3\u003e处理并发索引构建失败（案例：\u003ccode\u003eindex_build_conflict\u003c/code\u003e）\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"/docs/18/sql-createindex.html\" rel=\"nofollow\"\u003eCREATE INDEX 文档\u003c/a\u003e 说明，如果并发构建的扫描遇到唯一性失败等问题，可能留下 \u003ccode\u003eINVALID\u003c/code\u003e 索引。在本次重复扫描案例中，\u003ccode\u003epg_index\u003c/code\u003e 显示 \u003ccode\u003eindisvalid=false\u003c/code\u003e、\u003ccode\u003eindisready=false\u003c/code\u003e、\u003ccode\u003eindislive=true\u003c/code\u003e、\u003ccode\u003eindisunique=true\u003c/code\u003e；普通事务性构建回滚后没有留下索引。解决重复数据后检查实际目录状态，适当时删除遗留的无效索引，再重新构建。不要把这一状态推广到 \u003ccode\u003eCREATE INDEX CONCURRENTLY\u003c/code\u003e 的所有失败阶段。\u003c/p\u003e\n\u003ch2\u003e版本与边界 {#versions}\u003c/h2\u003e\n\u003cp\u003ePostgreSQL 10.21 和 18.6 都实际观察到了相同 SQLSTATE。两版源码行号和内部函数名不同；兼容性判断应使用 SQLSTATE 与操作上下文，而不是使用源码行号。\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eUNIQUE NULLS NOT DISTINCT\u003c/code\u003e 在 PostgreSQL 15 及以后可用，且必须显式选择。运行案例向默认唯一列插入两个 NULL 成功；向单独声明的 \u003ccode\u003eUNIQUE NULLS NOT DISTINCT\u003c/code\u003e 约束插入第二个 NULL 时产生 \u003ccode\u003e23505\u003c/code\u003e。升级不会默默把旧约束的默认语义改成 NULLS NOT DISTINCT。\u003c/p\u003e\n\u003cp\u003e单独的版本边界对照已经实际记录了可用性和行为：PostgreSQL 14.24 接受普通唯一列的两个 NULL，但显式声明因 \u003ccode\u003e42601\u003c/code\u003e 拒绝且没有 \u003ccode\u003e23505\u003c/code\u003e；PostgreSQL 15.19 在显式约束的第二个 NULL 上产生 \u003ccode\u003e23505\u003c/code\u003e，自动提交会话保持 \u003ccode\u003eIDLE\u003c/code\u003e，并成功提交有效值修复。这些记录单独保留，不增加基础选定案例数量。在其他临时目标上执行时，应先检查版本并按分支运行：先执行 \u003ccode\u003eordinary_create\u003c/code\u003e、\u003ccode\u003eordinary_first\u003c/code\u003e、\u003ccode\u003eordinary_second\u003c/code\u003e、\u003ccode\u003eordinary_verify\u003c/code\u003e，再执行 \u003ccode\u003eexplicit_create\u003c/code\u003e；如果得到 PG14 预期的 \u003ccode\u003e42601\u003c/code\u003e，就在这里停止，不要发送 \u003ccode\u003eexplicit_first\u003c/code\u003e、\u003ccode\u003eexplicit_second\u003c/code\u003e、\u003ccode\u003eexplicit_repair\u003c/code\u003e 或 \u003ccode\u003eexplicit_verify\u003c/code\u003e。只有 \u003ccode\u003eexplicit_create\u003c/code\u003e 在 PG15 或更高版本成功后，才继续显式插入、观察第二个 NULL 的结果，再执行修复和验证。\u003c/p\u003e\n\u003cpre\u003e\u003ccode\u003e-- ordinary_create\nCREATE TABLE ordinary_nulls (external_id integer UNIQUE);\n-- ordinary_first\nINSERT INTO ordinary_nulls VALUES (NULL);\n-- ordinary_second\nINSERT INTO ordinary_nulls VALUES (NULL);\n-- ordinary_verify\nSELECT count(*) FROM ordinary_nulls;\n-- explicit_create\nCREATE TABLE explicit_nulls (external_id integer, CONSTRAINT nulls_not_distinct_uq UNIQUE NULLS NOT DISTINCT (external_id));\n-- explicit_first\nINSERT INTO explicit_nulls VALUES (NULL);\n-- explicit_second\nINSERT INTO explicit_nulls VALUES (NULL);\n-- explicit_repair\nINSERT INTO explicit_nulls VALUES (1);\n-- explicit_verify\nSELECT count(*) FROM explicit_nulls;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003ePostgreSQL 18 的逻辑冲突报告器使用 \u003ccode\u003einsert_exists\u003c/code\u003e 等标签。消息改变并不意味着相关唯一冲突换成了别的 SQLSTATE。本批证据来自源码和文档；运行报告没有声称测试了复制拓扑。\u003c/p\u003e\n\u003cp\u003e锁定目录在 PostgreSQL 7.4 的定义中已观察到 \u003ccode\u003e23505\u003c/code\u003e，并持续到 8.4.22 的 pre-9.0 定义；随后在列出的所有正式快照直到 PostgreSQL 18.6 以及 PostgreSQL 19 Beta 3 预览中存在。这是 definition_only 的存在边界，不是确切实现引入版本或运行时使用断言。\u003c/p\u003e\n\u003ch2\u003e相关代码 {#related}\u003c/h2\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"/wiki/sqlstate/25P02/\" rel=\"nofollow\"\u003e\u003ccode\u003e25P02\u003c/code\u003e — in_failed_sql_transaction\u003c/a\u003e 说明显式事务中未处理语句失败后的后续错误。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/wiki/sqlstate/40001/\" rel=\"nofollow\"\u003e\u003ccode\u003e40001\u003c/code\u003e — serialization_failure\u003c/a\u003e 与 \u003ca href=\"/wiki/sqlstate/40P01/\" rel=\"nofollow\"\u003e\u003ccode\u003e40P01\u003c/code\u003e — deadlock_detected\u003c/a\u003e 是主要的事务重试相关错误；PostgreSQL 也记录了特定的 \u003ccode\u003e23505\u003c/code\u003e 键选择竞态。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/wiki/sqlstate/23503/\" rel=\"nofollow\"\u003e\u003ccode\u003e23503\u003c/code\u003e — foreign_key_violation\u003c/a\u003e 也是 Class 23 完整性错误，但缺少被引用行的诊断和修复步骤不同。\u003c/li\u003e\n\u003c/ul\u003e\n\u003ch2\u003e来源与证据 {#sources}\u003c/h2\u003e\n\u003cp\u003e本页使用的证据 ID 是\u003ca href=\"#sources\" rel=\"nofollow\"\u003e公开证据 JSON\u003c/a\u003e中的 \u003ccode\u003eidentity.class-and-condition\u003c/code\u003e、\u003ccode\u003eruntime.dml-template\u003c/code\u003e、\u003ccode\u003eruntime.protocol-fields\u003c/code\u003e、\u003ccode\u003eruntime.index-build-template\u003c/code\u003e、\u003ccode\u003eruntime.logical-apply-sqlstate\u003c/code\u003e、\u003ccode\u003eruntime.tx-contexts\u003c/code\u003e、\u003ccode\u003eruntime.retry-boundary\u003c/code\u003e、\u003ccode\u003eruntime.on-conflict-scope\u003c/code\u003e、\u003ccode\u003eruntime.sequence-repair-limit\u003c/code\u003e、\u003ccode\u003eruntime.nulls-choice\u003c/code\u003e、\u003ccode\u003eruntime.detail-visibility\u003c/code\u003e 和 \u003ccode\u003eruntime.version-boundary\u003c/code\u003e。选定的运行记录对未替代案例使用完整运行，对 DML 使用 \u003ccode\u003e23505-diagnostic-snippet-20260909\u003c/code\u003e，对精确 collector 关联使用 \u003ccode\u003e23505-log-fields-final-20260909\u003c/code\u003e，对 registry 片段使用 \u003ccode\u003e23505-snippet-contract-20260909\u003c/code\u003e，对显式事务和保存点恢复使用 manual-boundary run。单独的边界记录是 \u003ccode\u003eruntime.23505-boundary-pg14-20260909.pg14\u003c/code\u003e 和 \u003ccode\u003eruntime.23505-boundary-pg15-20260909.pg15\u003c/code\u003e，用于版本对照，不增加基础案例数量。被替代的完整运行选择仅保留为本地审计数据。\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L235-L241\" rel=\"nofollow\"\u003e固定源码提交中的 PostgreSQL 18.6 \u003ccode\u003eerrcodes.txt\u003c/code\u003e\u003c/a\u003e —— Class 23 与 \u003ccode\u003eunique_violation\u003c/code\u003e 身份。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtinsert.c#L640-L674\" rel=\"nofollow\"\u003e固定源码提交中的 PostgreSQL 18.6 nbtree 唯一性检查\u003c/a\u003e —— DML 报文与协议对象字段。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/index/genam.c#L155-L275\" rel=\"nofollow\"\u003e固定源码提交中的 PostgreSQL 18.6 索引值描述\u003c/a\u003e —— detail 可见性限制。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/sort/tuplesortvariants.c#L1670-L1694\" rel=\"nofollow\"\u003e固定源码提交中的 PostgreSQL 18.6 索引构建错误\u003c/a\u003e —— 独立的构建报文模板。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/replication/logical/conflict.c#L102-L180\" rel=\"nofollow\"\u003e固定源码提交中的 PostgreSQL 18.6 逻辑冲突报告器\u003c/a\u003e —— 应用标签和 SQLSTATE 映射。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/docs/18/sql-insert.html\" rel=\"nofollow\"\u003eINSERT 命令参考\u003c/a\u003e —— 冲突目标范围和 arbiter 限制。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/docs/18/sql-createindex.html\" rel=\"nofollow\"\u003eCREATE INDEX 命令参考\u003c/a\u003e —— 并发构建阶段和无效索引行为。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/docs/18/protocol-error-fields.html\" rel=\"nofollow\"\u003eError and Notice Message Fields\u003c/a\u003e 与 \u003ca href=\"/docs/18/runtime-config-logging.html\" rel=\"nofollow\"\u003e服务器日志配置\u003c/a\u003e —— 协议字段与 collector 字段的区别。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/docs/18/plpgsql-control-structures.html\" rel=\"nofollow\"\u003ePL/pgSQL 控制结构\u003c/a\u003e、\u003ca href=\"/docs/18/tutorial-transactions.html\" rel=\"nofollow\"\u003e事务教程\u003c/a\u003e 和\u003ca href=\"/docs/18/functions-sequence.html\" rel=\"nofollow\"\u003e序列函数\u003c/a\u003e —— 恢复与受控修复语义。\u003c/li\u003e\n\u003c/ul\u003e\n","SourceRevision":"english-manuals:80d4516037e6dac2ecaca604550622754952d6d2209097d343ab740fddb6091e","ContentHash":"5a89d025c0937887d641be548678f361e1f71f46edf1d591b5eb35ec9f5e4647","Payload":{"body_md":"\n## 速览 {#at-a-glance}\n\n`23505` 是 PostgreSQL 的 `unique_violation` 条件。当行、索引构建或逻辑应用发现某个值不能与正在执行的唯一性约束共存时，就会产生这个状态码。\n\n第一步应保存完整的 ErrorResponse 以及失败的语句。最有用的字段是 `C`（SQLSTATE）、`M`（主消息）、`D`（detail），以及在服务器提供时的 `s`（schema）、`t`（table）和 `n`（constraint 或 index）。在 psycopg 中，这些字段位于 `exc.sqlstate` 和 `exc.diag`。对象字段属于线协议；它们不是 CSV 日志的标准列名，也不是 JSON 日志的标准键名。\n\n恢复方式取决于错误发生的位置：\n\n- 自动提交语句失败，但连接可以继续接收下一条命令。\n- 显式事务中的语句失败后，事务进入中止状态。必须回滚整个事务，或回滚到保存点，然后才能继续发语句；否则 PostgreSQL 会返回 `25P02`。\n- 延迟唯一约束可以暂时接受重复行，并在 `COMMIT` 时报告 `23505`。\n- PL/pgSQL 的 `EXCEPTION` 块可以在子事务中捕获该冲突，但处理器必须足够窄，能够确认究竟是哪一个操作失败。\n\n当前选定的公开运行记录按案例和目标覆盖 PostgreSQL 18.6 的 12 个独立通过案例，以及 PostgreSQL 10.21 的 11 个通过案例；`NULLS NOT DISTINCT` 在 PG10 标为不适用。完整运行仍为未被替代案例的来源；定向最终记录分别选择 DML 诊断、精确的 `log_fields` 关联、registry 片段和手动事务边界，不重复或覆盖这些案例。另有 PG14.24/PG15.19 的版本边界对照：PG14 的显式 `UNIQUE NULLS NOT DISTINCT` 只得到不支持语法的 `42601`，PG15 则在第二个 NULL 上实际得到 `23505`；该对照不计入上述基础数量。选定 run ID 和结构化观察保存在[公开证据 JSON](#sources)中；被替代的 summary 与原始 JSONL 仅保留为本地审计数据。\n\n\n上面的生成锁定快照表示目录定义文件的版本覆盖。本页的可执行兼容性目标是 PostgreSQL 18.6 和 10.21；目录条目不声称 23505 是 PostgreSQL 10 才引入的。\n\n## 含义与触发路径 {#meaning}\n\nSQLSTATE 目录把 `23505` 放在 Class 23 `integrity_constraint_violation` 下，条件名为 `unique_violation`。在普通 btree 路径中，PostgreSQL 检查索引项；如果冲突的已提交键或并发插入键不符合索引语义允许的条件，就会报告错误。主键也是唯一索引，因此重复主键值同样使用这个状态码。\n\n同一个 SQLSTATE 可以描述多种机制：\n\n1. **违反 DML 唯一约束或索引。** `INSERT`，以及改变键值的 `UPDATE`，都可能与唯一索引保护的已有行冲突。普通消息模板是 `duplicate key value violates unique constraint \"...\"`，可选的 detail 是 `Key (...)=(...) already exists.`。\n2. **构建唯一索引。** 在已有重复行的表上构建唯一索引时使用另一套模板：`could not create unique index \"...\"`，detail 为 `Key (...)=(...) is duplicated.`。这是索引构建失败，不是普通行插入消息。\n3. **延迟约束。** 使用 `DEFERRABLE INITIALLY DEFERRED` 时，重复值可以留在事务中，直到提交时检查约束。因此错误对应 `COMMIT`，失败的顶层提交会回滚该事务。\n4. **逻辑复制应用。** PostgreSQL 18 会把应用冲突分类为 `insert_exists` 等；冲突报告器仍将相关的 insert、update 和 multiple-unique 路径映射到 `23505`。其消息形态和服务器日志上下文与客户端 btree 插入不同。本页有该路径的源码和文档证据，但当前运行批次没有建立 publisher/subscriber 拓扑。\n\n状态码说明了条件所属的类别，但不能单独说明冲突是持久的业务重复、键选择竞态，还是维护操作失败。需要结合语句、schema、约束定义、事务上下文和并发活动作出判断。\n\n下面的 SQL 代码块是与指定案例同一操作的说明性片段。权威可执行来源是 `scripts/verify_cases.py` 和 `verify/cases/23505/cases.json`；片段只省略临时 schema 命名和清理，并标明案例 ID，不构成第二套可运行案例定义。\n\n## 报文与诊断字段 {#messages}\n\n在 PostgreSQL 18.6 源码的 `nbtinsert.c` 普通路径中，服务器调用 `BuildIndexValueDescription`，报告唯一性错误，并附加表和约束身份。一次真实运行记录如下：\n\n```text\nSQLSTATE: 23505\nseverity: ERROR\nmessage_primary: duplicate key value violates unique constraint \"users_email_key\"\nmessage_detail: Key (email)=(a@example.test) already exists.\nschema_name: c23505_dml_unique_conflict\ntable_name: users\nconstraint_name: users_email_key\nsource: nbtinsert.c / _bt_check_unique\n```\n\ndetail 不是必然存在的。如果调用者没有权限查看相关列，行级安全策略阻止描述，或者索引是表达式索引，PostgreSQL 可能省略键值。相同运行中的 INSERT-only 角色仍得到 SQLSTATE 和对象身份，但没有 `message_detail`。\n\n协议字段定义在 [Error and Notice Message Fields](/docs/18/protocol-error-fields.html) 中。应从驱动异常读取这些字段，不要从日志解析器推断。18.6 的日志配置文档描述了 CSV 的 `sql_state_code`、`message`、`detail` 等字段，以及 JSON 的 `state_code`、`message`、`detail` 等键；两种格式都没有把协议中的 `constraint_name` 定义为标准日志字段。定向 `log_fields` run 按同一后端 PID、模式/表、约束、主消息和 detail 将 collector 记录与驱动诊断逐项匹配：PostgreSQL 18.6 同时得到 CSV 和 JSON，PostgreSQL 10.21 得到 CSV。\n\n索引构建报文明确不同：\n\n```text\nSQLSTATE: 23505\nmessage_primary: could not create unique index \"idx_concurrent\"\nmessage_detail: Key (email)=(dup) is duplicated.\nsource: tuplesortvariants.c / comparetup_index_btree_tiebreak\n```\n\n不要只解析英文报文来分类错误。应先按 SQLSTATE 分支，再使用结构化字段和操作上下文。消息文本可能随本地化变化，而五字符 SQLSTATE 是稳定的线协议值。\n\n## 诊断 {#diagnosis}\n\n记录失败语句、SQLSTATE、主消息、detail、hint、schema/table/constraint 字段、服务器版本和事务状态。驱动应保留原始异常；通用 ORM 错误字符串可能丢掉定位冲突对象所需的字段。\n\n针对某个表，在修改数据前同时检查约束和索引。下面两条查询就是运行器使用的 `diagnostic_catalog_queries`；隔离运行会对其 `accounts` 表实际执行：\n\n```sql\nSELECT conname, contype, condeferrable, condeferred,\n       pg_get_constraintdef(oid)\nFROM pg_constraint\nWHERE conrelid = 'accounts'::regclass;\n\nSELECT indexrelid::regclass AS index_name,\n       indisunique, indisvalid, indisready, indislive,\n       pg_get_indexdef(indexrelid)\nFROM pg_index\nWHERE indrelid = 'accounts'::regclass;\n```\n\n对于普通 DML 错误，将尝试写入的键与命名约束保护的行进行比较。检查该表上的每一项唯一性约束；语句指定了一个冲突目标，也仍可能违反另一个唯一约束。对于索引构建错误，在重试前找出重复键，并在并发构建失败后检查 `pg_index`。\n\n运行案例 `concurrent_unique_conflict` 使用两个会话和一个观察会话。会话 A 持有未提交的 `token='raced'`；在 A 提交前，观察会话看到 B 的语句 `wait_event_type=Lock`、`wait_event=transactionid`。A 提交后，B 收到 `23505`，并在回滚前处于 `INERROR`。这个同步条件证明了事件顺序；固定 sleep 不能提供同等证据。\n\n## 处置与修复 {#response}\n\n### 先恢复事务（案例：`explicit_tx_abort_recovery`、`savepoint_recovery`）\n\n启用自动提交时，失败操作已经结束，运行案例中的连接状态为 `IDLE`。应用应先决定如何处理输入，再发起下一条命令。\n\n在显式事务中，第一次失败后不要继续使用该连接，先处理失败事务：\n\n下面的 `INSERT INTO items VALUES (3, 'seed')` 是真实的重复键触发；后面的 `ROLLBACK` 是必须的恢复操作。\n\n```sql\nCREATE TABLE items(id integer PRIMARY KEY, note text UNIQUE NOT NULL);\nINSERT INTO items VALUES (1, 'seed');\nBEGIN;\nINSERT INTO items VALUES (2, 'outer');\nINSERT INTO items VALUES (3, 'seed');\nROLLBACK;\nBEGIN;\nINSERT INTO items VALUES (2, 'after rollback');\nCOMMIT;\n```\n\n如果只有一小段工作是可选的，可以使用保存点保留外层工作：\n\n保存点之后的插入复用了已经准备好的唯一值，因此是真实的 `23505` 触发；`ROLLBACK TO SAVEPOINT` 只撤销这段失败的子事务。\n\n```sql\nCREATE TABLE items(id integer PRIMARY KEY, note text UNIQUE NOT NULL);\nINSERT INTO items VALUES (1, 'seed');\nBEGIN;\nINSERT INTO items VALUES (2, 'outer');\nSAVEPOINT unique_case;\nINSERT INTO items VALUES (3, 'seed');\n-- 事务失败时，这条语句预期返回 25P02。\nSELECT count(*) FROM items;\nROLLBACK TO SAVEPOINT unique_case;\nINSERT INTO items VALUES (3, 'after savepoint');\nRELEASE SAVEPOINT unique_case;\nCOMMIT;\n```\n\n运行器在回滚前执行 `SELECT` 时观察到 `25P02`，在 `ROLLBACK TO SAVEPOINT` 后观察到 `INTRANS`。普通 `ROLLBACK` 会让显式事务回到 `IDLE`；`ROLLBACK TO` 会保留保存点之前的工作。\n\n延迟约束会改变错误发生的阶段（案例：`deferred_commit_conflict`）。在真实案例中，两次重复插入在连接处于 `INTRANS` 时都成功；随后 `COMMIT` 报 `23505`，连接回到 `IDLE`，失败顶层事务产生的行数为零。应在提交前修复键，或回滚并重试整个工作单元。\n\nPL/pgSQL 可以在异常块中处理自然产生的唯一性冲突（案例：`plpgsql_exception_recovery`）：\n\n```sql\nCREATE TABLE items(id integer PRIMARY KEY, note text);\nINSERT INTO items(id, note) VALUES (1, 'seed');\n\nCREATE FUNCTION try_insert(wanted integer) RETURNS text\nLANGUAGE plpgsql AS $$\nDECLARE returned_state text;\nBEGIN\n    INSERT INTO items(id, note) VALUES (wanted, 'body');\n    RETURN 'inserted';\nEXCEPTION WHEN unique_violation THEN\n    GET STACKED DIAGNOSTICS returned_state = RETURNED_SQLSTATE;\n    INSERT INTO items(id, note) VALUES (wanted + 1, 'handler');\n    RETURN returned_state;\nEND\n$$;\n\nSELECT try_insert(1);\n```\n\n受保护的代码块具有子事务行为。发生错误时，该代码块内部已经写入的持久化改动会在处理器运行前回滚；进入代码块之前的改动仍会保留。异常块应保持窄范围：如果其中有多条可能违反不同唯一约束的语句，那么捕获到 `unique_violation` 本身不能证明是哪一条操作造成了它。PostgreSQL 的 PL/pgSQL 文档也针对通用 upsert 处理器提醒了这一点。\n\n### 选择符合业务语义的操作（案例：`on_conflict_target_scope`）\n\n`ON CONFLICT` 用于表达明确的冲突策略，不是隐藏所有重复行的通用指令。冲突目标决定 arbiter。在运行案例中，已有行占用了 `phone='phone-1'`：\n\n```sql\nCREATE TABLE accounts(\n    id integer PRIMARY KEY,\n    email text NOT NULL,\n    phone text NOT NULL,\n    CONSTRAINT accounts_email_uq UNIQUE (email),\n    CONSTRAINT accounts_phone_uq UNIQUE (phone)\n);\nINSERT INTO accounts VALUES (1, 'existing@example.test', 'phone-1');\n\nINSERT INTO accounts(id,email,phone)\nVALUES (2, 'existing@example.test', 'phone-2')\nON CONFLICT (email) DO NOTHING;\n\n-- 只处理 email 冲突。仅 phone 冲突时仍会产生 23505。\nINSERT INTO accounts(id,email,phone)\nVALUES (3, 'new@example.test', 'phone-1')\nON CONFLICT (email) DO NOTHING;\n\n-- 省略 target 时，DO NOTHING 覆盖任一可用 arbiter 的冲突。\nINSERT INTO accounts(id,email,phone)\nVALUES (4, 'third@example.test', 'phone-1')\nON CONFLICT DO NOTHING;\n```\n\n对于 `DO UPDATE`，应确保更新是确定性的，并检查其业务结果。对于幂等键，应将传入请求的相关身份和参数与已存请求比较，再核对已有业务结果，然后才能返回“已经处理”。仅发生幂等键碰撞，不能证明先前请求等价。\n\n### 谨慎修复序列（案例：`sequence_lag_repair`）\n\n手动指定键可能使序列落后于表。受控运行案例使用了非默认序列：\n\n下面第二个使用 `nextval` 的插入是真实的重复键触发；`setval` 后又执行了一次真实插入，以验证修复后的下一个值。\n\n```sql\nCREATE SEQUENCE ids_seq START WITH 100 INCREMENT BY 7 MINVALUE 100 MAXVALUE 100000;\nCREATE TABLE items(id integer PRIMARY KEY, note text);\nINSERT INTO items(id,note) VALUES (100, 'explicit');\nINSERT INTO items(id,note) VALUES (nextval('ids_seq'), 'generated');\nSELECT setval('ids_seq', (SELECT max(id) FROM items), true);\nINSERT INTO items(id,note) VALUES (nextval('ids_seq'), 'after repair');\n```\n\n受控 `setval` 后下一值为 107。这种修复有明确前提：暂停写入者，确认序列身份和所有关系，空表不能传入无效值，并检查 increment、边界、cache 和 `is_called`。`setval` 不是通用的并发修复；序列变更也不会像普通表写入那样回滚。\n\n### 只有在操作可重试时才重试\n\n[序列化失败处理文档](/docs/18/mvcc-serialization-failure-handling.html) 说明了某些并发选择键的场景可能以 `23505` 呈现。应用确认属于这种语义后，应重试完整事务（包括选择键的逻辑），并配合有界退避和幂等策略。不要盲目重试：用户明确请求的重复可能是永久条件，反复尝试也可能得到同一冲突。\n\n双会话案例证明了锁顺序建立后会出现冲突，但运行器没有声称所有相同状态码的业务操作都可以安全重试。\n\n### 处理并发索引构建失败（案例：`index_build_conflict`）\n\n[CREATE INDEX 文档](/docs/18/sql-createindex.html) 说明，如果并发构建的扫描遇到唯一性失败等问题，可能留下 `INVALID` 索引。在本次重复扫描案例中，`pg_index` 显示 `indisvalid=false`、`indisready=false`、`indislive=true`、`indisunique=true`；普通事务性构建回滚后没有留下索引。解决重复数据后检查实际目录状态，适当时删除遗留的无效索引，再重新构建。不要把这一状态推广到 `CREATE INDEX CONCURRENTLY` 的所有失败阶段。\n\n## 版本与边界 {#versions}\n\nPostgreSQL 10.21 和 18.6 都实际观察到了相同 SQLSTATE。两版源码行号和内部函数名不同；兼容性判断应使用 SQLSTATE 与操作上下文，而不是使用源码行号。\n\n`UNIQUE NULLS NOT DISTINCT` 在 PostgreSQL 15 及以后可用，且必须显式选择。运行案例向默认唯一列插入两个 NULL 成功；向单独声明的 `UNIQUE NULLS NOT DISTINCT` 约束插入第二个 NULL 时产生 `23505`。升级不会默默把旧约束的默认语义改成 NULLS NOT DISTINCT。\n\n单独的版本边界对照已经实际记录了可用性和行为：PostgreSQL 14.24 接受普通唯一列的两个 NULL，但显式声明因 `42601` 拒绝且没有 `23505`；PostgreSQL 15.19 在显式约束的第二个 NULL 上产生 `23505`，自动提交会话保持 `IDLE`，并成功提交有效值修复。这些记录单独保留，不增加基础选定案例数量。在其他临时目标上执行时，应先检查版本并按分支运行：先执行 `ordinary_create`、`ordinary_first`、`ordinary_second`、`ordinary_verify`，再执行 `explicit_create`；如果得到 PG14 预期的 `42601`，就在这里停止，不要发送 `explicit_first`、`explicit_second`、`explicit_repair` 或 `explicit_verify`。只有 `explicit_create` 在 PG15 或更高版本成功后，才继续显式插入、观察第二个 NULL 的结果，再执行修复和验证。\n\n```sql\n-- ordinary_create\nCREATE TABLE ordinary_nulls (external_id integer UNIQUE);\n-- ordinary_first\nINSERT INTO ordinary_nulls VALUES (NULL);\n-- ordinary_second\nINSERT INTO ordinary_nulls VALUES (NULL);\n-- ordinary_verify\nSELECT count(*) FROM ordinary_nulls;\n-- explicit_create\nCREATE TABLE explicit_nulls (external_id integer, CONSTRAINT nulls_not_distinct_uq UNIQUE NULLS NOT DISTINCT (external_id));\n-- explicit_first\nINSERT INTO explicit_nulls VALUES (NULL);\n-- explicit_second\nINSERT INTO explicit_nulls VALUES (NULL);\n-- explicit_repair\nINSERT INTO explicit_nulls VALUES (1);\n-- explicit_verify\nSELECT count(*) FROM explicit_nulls;\n```\n\nPostgreSQL 18 的逻辑冲突报告器使用 `insert_exists` 等标签。消息改变并不意味着相关唯一冲突换成了别的 SQLSTATE。本批证据来自源码和文档；运行报告没有声称测试了复制拓扑。\n\n锁定目录在 PostgreSQL 7.4 的定义中已观察到 `23505`，并持续到 8.4.22 的 pre-9.0 定义；随后在列出的所有正式快照直到 PostgreSQL 18.6 以及 PostgreSQL 19 Beta 3 预览中存在。这是 definition_only 的存在边界，不是确切实现引入版本或运行时使用断言。\n\n## 相关代码 {#related}\n\n- [`25P02` — in_failed_sql_transaction](/wiki/sqlstate/25P02/) 说明显式事务中未处理语句失败后的后续错误。\n- [`40001` — serialization_failure](/wiki/sqlstate/40001/) 与 [`40P01` — deadlock_detected](/wiki/sqlstate/40P01/) 是主要的事务重试相关错误；PostgreSQL 也记录了特定的 `23505` 键选择竞态。\n- [`23503` — foreign_key_violation](/wiki/sqlstate/23503/) 也是 Class 23 完整性错误，但缺少被引用行的诊断和修复步骤不同。\n\n## 来源与证据 {#sources}\n\n本页使用的证据 ID 是[公开证据 JSON](#sources)中的 `identity.class-and-condition`、`runtime.dml-template`、`runtime.protocol-fields`、`runtime.index-build-template`、`runtime.logical-apply-sqlstate`、`runtime.tx-contexts`、`runtime.retry-boundary`、`runtime.on-conflict-scope`、`runtime.sequence-repair-limit`、`runtime.nulls-choice`、`runtime.detail-visibility` 和 `runtime.version-boundary`。选定的运行记录对未替代案例使用完整运行，对 DML 使用 `23505-diagnostic-snippet-20260909`，对精确 collector 关联使用 `23505-log-fields-final-20260909`，对 registry 片段使用 `23505-snippet-contract-20260909`，对显式事务和保存点恢复使用 manual-boundary run。单独的边界记录是 `runtime.23505-boundary-pg14-20260909.pg14` 和 `runtime.23505-boundary-pg15-20260909.pg15`，用于版本对照，不增加基础案例数量。被替代的完整运行选择仅保留为本地审计数据。\n\n- [固定源码提交中的 PostgreSQL 18.6 `errcodes.txt`](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L235-L241) —— Class 23 与 `unique_violation` 身份。\n- [固定源码提交中的 PostgreSQL 18.6 nbtree 唯一性检查](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtinsert.c#L640-L674) —— DML 报文与协议对象字段。\n- [固定源码提交中的 PostgreSQL 18.6 索引值描述](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/index/genam.c#L155-L275) —— detail 可见性限制。\n- [固定源码提交中的 PostgreSQL 18.6 索引构建错误](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/sort/tuplesortvariants.c#L1670-L1694) —— 独立的构建报文模板。\n- [固定源码提交中的 PostgreSQL 18.6 逻辑冲突报告器](https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/replication/logical/conflict.c#L102-L180) —— 应用标签和 SQLSTATE 映射。\n- [INSERT 命令参考](/docs/18/sql-insert.html) —— 冲突目标范围和 arbiter 限制。\n- [CREATE INDEX 命令参考](/docs/18/sql-createindex.html) —— 并发构建阶段和无效索引行为。\n- [Error and Notice Message Fields](/docs/18/protocol-error-fields.html) 与 [服务器日志配置](/docs/18/runtime-config-logging.html) —— 协议字段与 collector 字段的区别。\n- [PL/pgSQL 控制结构](/docs/18/plpgsql-control-structures.html)、[事务教程](/docs/18/tutorial-transactions.html) 和[序列函数](/docs/18/functions-sequence.html) —— 恢复与受控修复语义。\n","description":"当行或索引操作违反唯一性约束时，PostgreSQL 会报告 23505。应先诊断对象和事务状态，再选择符合业务语义的修复。","is_stale":false,"name":"唯一性冲突","sections":[{"anchor":"at-a-glance","heading":"速览","html":"\u003cp\u003e\u003ccode\u003e23505\u003c/code\u003e 是 PostgreSQL 的 \u003ccode\u003eunique_violation\u003c/code\u003e 条件。当行、索引构建或逻辑应用发现某个值不能与正在执行的唯一性约束共存时，就会产生这个状态码。\u003c/p\u003e\n\u003cp\u003e第一步应保存完整的 ErrorResponse 以及失败的语句。最有用的字段是 \u003ccode\u003eC\u003c/code\u003e（SQLSTATE）、\u003ccode\u003eM\u003c/code\u003e（主消息）、\u003ccode\u003eD\u003c/code\u003e（detail），以及在服务器提供时的 \u003ccode\u003es\u003c/code\u003e（schema）、\u003ccode\u003et\u003c/code\u003e（table）和 \u003ccode\u003en\u003c/code\u003e（constraint 或 index）。在 psycopg 中，这些字段位于 \u003ccode\u003eexc.sqlstate\u003c/code\u003e 和 \u003ccode\u003eexc.diag\u003c/code\u003e。对象字段属于线协议；它们不是 CSV 日志的标准列名，也不是 JSON 日志的标准键名。\u003c/p\u003e\n\u003cp\u003e恢复方式取决于错误发生的位置：\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e自动提交语句失败，但连接可以继续接收下一条命令。\u003c/li\u003e\n\u003cli\u003e显式事务中的语句失败后，事务进入中止状态。必须回滚整个事务，或回滚到保存点，然后才能继续发语句；否则 PostgreSQL 会返回 \u003ccode\u003e25P02\u003c/code\u003e。\u003c/li\u003e\n\u003cli\u003e延迟唯一约束可以暂时接受重复行，并在 \u003ccode\u003eCOMMIT\u003c/code\u003e 时报告 \u003ccode\u003e23505\u003c/code\u003e。\u003c/li\u003e\n\u003cli\u003ePL/pgSQL 的 \u003ccode\u003eEXCEPTION\u003c/code\u003e 块可以在子事务中捕获该冲突，但处理器必须足够窄，能够确认究竟是哪一个操作失败。\u003c/li\u003e\n\u003c/ul\u003e\n\u003cp\u003e当前选定的公开运行记录按案例和目标覆盖 PostgreSQL 18.6 的 12 个独立通过案例，以及 PostgreSQL 10.21 的 11 个通过案例；\u003ccode\u003eNULLS NOT DISTINCT\u003c/code\u003e 在 PG10 标为不适用。完整运行仍为未被替代案例的来源；定向最终记录分别选择 DML 诊断、精确的 \u003ccode\u003elog_fields\u003c/code\u003e 关联、registry 片段和手动事务边界，不重复或覆盖这些案例。另有 PG14.24/PG15.19 的版本边界对照：PG14 的显式 \u003ccode\u003eUNIQUE NULLS NOT DISTINCT\u003c/code\u003e 只得到不支持语法的 \u003ccode\u003e42601\u003c/code\u003e，PG15 则在第二个 NULL 上实际得到 \u003ccode\u003e23505\u003c/code\u003e；该对照不计入上述基础数量。选定 run ID 和结构化观察保存在\u003ca href=\"#sources\"\u003e公开证据 JSON\u003c/a\u003e中；被替代的 summary 与原始 JSONL 仅保留为本地审计数据。\u003c/p\u003e\n\u003cp\u003e上面的生成锁定快照表示目录定义文件的版本覆盖。本页的可执行兼容性目标是 PostgreSQL 18.6 和 10.21；目录条目不声称 23505 是 PostgreSQL 10 才引入的。\u003c/p\u003e"},{"anchor":"meaning","heading":"含义与触发路径","html":"\u003cp\u003eSQLSTATE 目录把 \u003ccode\u003e23505\u003c/code\u003e 放在 Class 23 \u003ccode\u003eintegrity_constraint_violation\u003c/code\u003e 下，条件名为 \u003ccode\u003eunique_violation\u003c/code\u003e。在普通 btree 路径中，PostgreSQL 检查索引项；如果冲突的已提交键或并发插入键不符合索引语义允许的条件，就会报告错误。主键也是唯一索引，因此重复主键值同样使用这个状态码。\u003c/p\u003e\n\u003cp\u003e同一个 SQLSTATE 可以描述多种机制：\u003c/p\u003e\n\u003col\u003e\n\u003cli\u003e\u003cstrong\u003e违反 DML 唯一约束或索引。\u003c/strong\u003e \u003ccode\u003eINSERT\u003c/code\u003e，以及改变键值的 \u003ccode\u003eUPDATE\u003c/code\u003e，都可能与唯一索引保护的已有行冲突。普通消息模板是 \u003ccode\u003eduplicate key value violates unique constraint \"...\"\u003c/code\u003e，可选的 detail 是 \u003ccode\u003eKey (...)=(...) already exists.\u003c/code\u003e。\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e构建唯一索引。\u003c/strong\u003e 在已有重复行的表上构建唯一索引时使用另一套模板：\u003ccode\u003ecould not create unique index \"...\"\u003c/code\u003e，detail 为 \u003ccode\u003eKey (...)=(...) is duplicated.\u003c/code\u003e。这是索引构建失败，不是普通行插入消息。\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e延迟约束。\u003c/strong\u003e 使用 \u003ccode\u003eDEFERRABLE INITIALLY DEFERRED\u003c/code\u003e 时，重复值可以留在事务中，直到提交时检查约束。因此错误对应 \u003ccode\u003eCOMMIT\u003c/code\u003e，失败的顶层提交会回滚该事务。\u003c/li\u003e\n\u003cli\u003e\u003cstrong\u003e逻辑复制应用。\u003c/strong\u003e PostgreSQL 18 会把应用冲突分类为 \u003ccode\u003einsert_exists\u003c/code\u003e 等；冲突报告器仍将相关的 insert、update 和 multiple-unique 路径映射到 \u003ccode\u003e23505\u003c/code\u003e。其消息形态和服务器日志上下文与客户端 btree 插入不同。本页有该路径的源码和文档证据，但当前运行批次没有建立 publisher/subscriber 拓扑。\u003c/li\u003e\n\u003c/ol\u003e\n\u003cp\u003e状态码说明了条件所属的类别，但不能单独说明冲突是持久的业务重复、键选择竞态，还是维护操作失败。需要结合语句、schema、约束定义、事务上下文和并发活动作出判断。\u003c/p\u003e\n\u003cp\u003e下面的 SQL 代码块是与指定案例同一操作的说明性片段。权威可执行来源是 \u003ccode\u003escripts/verify_cases.py\u003c/code\u003e 和 \u003ccode\u003everify/cases/23505/cases.json\u003c/code\u003e；片段只省略临时 schema 命名和清理，并标明案例 ID，不构成第二套可运行案例定义。\u003c/p\u003e"},{"anchor":"messages","heading":"报文与诊断字段","html":"\u003cp\u003e在 PostgreSQL 18.6 源码的 \u003ccode\u003enbtinsert.c\u003c/code\u003e 普通路径中，服务器调用 \u003ccode\u003eBuildIndexValueDescription\u003c/code\u003e，报告唯一性错误，并附加表和约束身份。一次真实运行记录如下：\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-text\"\u003eSQLSTATE: 23505\nseverity: ERROR\nmessage_primary: duplicate key value violates unique constraint \u0026quot;users_email_key\u0026quot;\nmessage_detail: Key (email)=(a@example.test) already exists.\nschema_name: c23505_dml_unique_conflict\ntable_name: users\nconstraint_name: users_email_key\nsource: nbtinsert.c / _bt_check_unique\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003edetail 不是必然存在的。如果调用者没有权限查看相关列，行级安全策略阻止描述，或者索引是表达式索引，PostgreSQL 可能省略键值。相同运行中的 INSERT-only 角色仍得到 SQLSTATE 和对象身份，但没有 \u003ccode\u003emessage_detail\u003c/code\u003e。\u003c/p\u003e\n\u003cp\u003e协议字段定义在 \u003ca href=\"/docs/18/protocol-error-fields.html\"\u003eError and Notice Message Fields\u003c/a\u003e 中。应从驱动异常读取这些字段，不要从日志解析器推断。18.6 的日志配置文档描述了 CSV 的 \u003ccode\u003esql_state_code\u003c/code\u003e、\u003ccode\u003emessage\u003c/code\u003e、\u003ccode\u003edetail\u003c/code\u003e 等字段，以及 JSON 的 \u003ccode\u003estate_code\u003c/code\u003e、\u003ccode\u003emessage\u003c/code\u003e、\u003ccode\u003edetail\u003c/code\u003e 等键；两种格式都没有把协议中的 \u003ccode\u003econstraint_name\u003c/code\u003e 定义为标准日志字段。定向 \u003ccode\u003elog_fields\u003c/code\u003e run 按同一后端 PID、模式/表、约束、主消息和 detail 将 collector 记录与驱动诊断逐项匹配：PostgreSQL 18.6 同时得到 CSV 和 JSON，PostgreSQL 10.21 得到 CSV。\u003c/p\u003e\n\u003cp\u003e索引构建报文明确不同：\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-text\"\u003eSQLSTATE: 23505\nmessage_primary: could not create unique index \u0026quot;idx_concurrent\u0026quot;\nmessage_detail: Key (email)=(dup) is duplicated.\nsource: tuplesortvariants.c / comparetup_index_btree_tiebreak\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e不要只解析英文报文来分类错误。应先按 SQLSTATE 分支，再使用结构化字段和操作上下文。消息文本可能随本地化变化，而五字符 SQLSTATE 是稳定的线协议值。\u003c/p\u003e"},{"anchor":"diagnosis","heading":"诊断","html":"\u003cp\u003e记录失败语句、SQLSTATE、主消息、detail、hint、schema/table/constraint 字段、服务器版本和事务状态。驱动应保留原始异常；通用 ORM 错误字符串可能丢掉定位冲突对象所需的字段。\u003c/p\u003e\n\u003cp\u003e针对某个表，在修改数据前同时检查约束和索引。下面两条查询就是运行器使用的 \u003ccode\u003ediagnostic_catalog_queries\u003c/code\u003e；隔离运行会对其 \u003ccode\u003eaccounts\u003c/code\u003e 表实际执行：\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003eSELECT conname, contype, condeferrable, condeferred,\n       pg_get_constraintdef(oid)\nFROM pg_constraint\nWHERE conrelid = 'accounts'::regclass;\n\nSELECT indexrelid::regclass AS index_name,\n       indisunique, indisvalid, indisready, indislive,\n       pg_get_indexdef(indexrelid)\nFROM pg_index\nWHERE indrelid = 'accounts'::regclass;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e对于普通 DML 错误，将尝试写入的键与命名约束保护的行进行比较。检查该表上的每一项唯一性约束；语句指定了一个冲突目标，也仍可能违反另一个唯一约束。对于索引构建错误，在重试前找出重复键，并在并发构建失败后检查 \u003ccode\u003epg_index\u003c/code\u003e。\u003c/p\u003e\n\u003cp\u003e运行案例 \u003ccode\u003econcurrent_unique_conflict\u003c/code\u003e 使用两个会话和一个观察会话。会话 A 持有未提交的 \u003ccode\u003etoken='raced'\u003c/code\u003e；在 A 提交前，观察会话看到 B 的语句 \u003ccode\u003ewait_event_type=Lock\u003c/code\u003e、\u003ccode\u003ewait_event=transactionid\u003c/code\u003e。A 提交后，B 收到 \u003ccode\u003e23505\u003c/code\u003e，并在回滚前处于 \u003ccode\u003eINERROR\u003c/code\u003e。这个同步条件证明了事件顺序；固定 sleep 不能提供同等证据。\u003c/p\u003e"},{"anchor":"response","heading":"处置与修复","html":"\u003ch3\u003e先恢复事务（案例：\u003ccode\u003eexplicit_tx_abort_recovery\u003c/code\u003e、\u003ccode\u003esavepoint_recovery\u003c/code\u003e）\u003c/h3\u003e\n\u003cp\u003e启用自动提交时，失败操作已经结束，运行案例中的连接状态为 \u003ccode\u003eIDLE\u003c/code\u003e。应用应先决定如何处理输入，再发起下一条命令。\u003c/p\u003e\n\u003cp\u003e在显式事务中，第一次失败后不要继续使用该连接，先处理失败事务：\u003c/p\u003e\n\u003cp\u003e下面的 \u003ccode\u003eINSERT INTO items VALUES (3, 'seed')\u003c/code\u003e 是真实的重复键触发；后面的 \u003ccode\u003eROLLBACK\u003c/code\u003e 是必须的恢复操作。\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003eCREATE TABLE items(id integer PRIMARY KEY, note text UNIQUE NOT NULL);\nINSERT INTO items VALUES (1, 'seed');\nBEGIN;\nINSERT INTO items VALUES (2, 'outer');\nINSERT INTO items VALUES (3, 'seed');\nROLLBACK;\nBEGIN;\nINSERT INTO items VALUES (2, 'after rollback');\nCOMMIT;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e如果只有一小段工作是可选的，可以使用保存点保留外层工作：\u003c/p\u003e\n\u003cp\u003e保存点之后的插入复用了已经准备好的唯一值，因此是真实的 \u003ccode\u003e23505\u003c/code\u003e 触发；\u003ccode\u003eROLLBACK TO SAVEPOINT\u003c/code\u003e 只撤销这段失败的子事务。\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003eCREATE TABLE items(id integer PRIMARY KEY, note text UNIQUE NOT NULL);\nINSERT INTO items VALUES (1, 'seed');\nBEGIN;\nINSERT INTO items VALUES (2, 'outer');\nSAVEPOINT unique_case;\nINSERT INTO items VALUES (3, 'seed');\n-- 事务失败时，这条语句预期返回 25P02。\nSELECT count(*) FROM items;\nROLLBACK TO SAVEPOINT unique_case;\nINSERT INTO items VALUES (3, 'after savepoint');\nRELEASE SAVEPOINT unique_case;\nCOMMIT;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e运行器在回滚前执行 \u003ccode\u003eSELECT\u003c/code\u003e 时观察到 \u003ccode\u003e25P02\u003c/code\u003e，在 \u003ccode\u003eROLLBACK TO SAVEPOINT\u003c/code\u003e 后观察到 \u003ccode\u003eINTRANS\u003c/code\u003e。普通 \u003ccode\u003eROLLBACK\u003c/code\u003e 会让显式事务回到 \u003ccode\u003eIDLE\u003c/code\u003e；\u003ccode\u003eROLLBACK TO\u003c/code\u003e 会保留保存点之前的工作。\u003c/p\u003e\n\u003cp\u003e延迟约束会改变错误发生的阶段（案例：\u003ccode\u003edeferred_commit_conflict\u003c/code\u003e）。在真实案例中，两次重复插入在连接处于 \u003ccode\u003eINTRANS\u003c/code\u003e 时都成功；随后 \u003ccode\u003eCOMMIT\u003c/code\u003e 报 \u003ccode\u003e23505\u003c/code\u003e，连接回到 \u003ccode\u003eIDLE\u003c/code\u003e，失败顶层事务产生的行数为零。应在提交前修复键，或回滚并重试整个工作单元。\u003c/p\u003e\n\u003cp\u003ePL/pgSQL 可以在异常块中处理自然产生的唯一性冲突（案例：\u003ccode\u003eplpgsql_exception_recovery\u003c/code\u003e）：\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003eCREATE TABLE items(id integer PRIMARY KEY, note text);\nINSERT INTO items(id, note) VALUES (1, 'seed');\n\nCREATE FUNCTION try_insert(wanted integer) RETURNS text\nLANGUAGE plpgsql AS $$\nDECLARE returned_state text;\nBEGIN\n    INSERT INTO items(id, note) VALUES (wanted, 'body');\n    RETURN 'inserted';\nEXCEPTION WHEN unique_violation THEN\n    GET STACKED DIAGNOSTICS returned_state = RETURNED_SQLSTATE;\n    INSERT INTO items(id, note) VALUES (wanted + 1, 'handler');\n    RETURN returned_state;\nEND\n$$;\n\nSELECT try_insert(1);\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e受保护的代码块具有子事务行为。发生错误时，该代码块内部已经写入的持久化改动会在处理器运行前回滚；进入代码块之前的改动仍会保留。异常块应保持窄范围：如果其中有多条可能违反不同唯一约束的语句，那么捕获到 \u003ccode\u003eunique_violation\u003c/code\u003e 本身不能证明是哪一条操作造成了它。PostgreSQL 的 PL/pgSQL 文档也针对通用 upsert 处理器提醒了这一点。\u003c/p\u003e\n\u003ch3\u003e选择符合业务语义的操作（案例：\u003ccode\u003eon_conflict_target_scope\u003c/code\u003e）\u003c/h3\u003e\n\u003cp\u003e\u003ccode\u003eON CONFLICT\u003c/code\u003e 用于表达明确的冲突策略，不是隐藏所有重复行的通用指令。冲突目标决定 arbiter。在运行案例中，已有行占用了 \u003ccode\u003ephone='phone-1'\u003c/code\u003e：\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003eCREATE TABLE accounts(\n    id integer PRIMARY KEY,\n    email text NOT NULL,\n    phone text NOT NULL,\n    CONSTRAINT accounts_email_uq UNIQUE (email),\n    CONSTRAINT accounts_phone_uq UNIQUE (phone)\n);\nINSERT INTO accounts VALUES (1, 'existing@example.test', 'phone-1');\n\nINSERT INTO accounts(id,email,phone)\nVALUES (2, 'existing@example.test', 'phone-2')\nON CONFLICT (email) DO NOTHING;\n\n-- 只处理 email 冲突。仅 phone 冲突时仍会产生 23505。\nINSERT INTO accounts(id,email,phone)\nVALUES (3, 'new@example.test', 'phone-1')\nON CONFLICT (email) DO NOTHING;\n\n-- 省略 target 时，DO NOTHING 覆盖任一可用 arbiter 的冲突。\nINSERT INTO accounts(id,email,phone)\nVALUES (4, 'third@example.test', 'phone-1')\nON CONFLICT DO NOTHING;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e对于 \u003ccode\u003eDO UPDATE\u003c/code\u003e，应确保更新是确定性的，并检查其业务结果。对于幂等键，应将传入请求的相关身份和参数与已存请求比较，再核对已有业务结果，然后才能返回“已经处理”。仅发生幂等键碰撞，不能证明先前请求等价。\u003c/p\u003e\n\u003ch3\u003e谨慎修复序列（案例：\u003ccode\u003esequence_lag_repair\u003c/code\u003e）\u003c/h3\u003e\n\u003cp\u003e手动指定键可能使序列落后于表。受控运行案例使用了非默认序列：\u003c/p\u003e\n\u003cp\u003e下面第二个使用 \u003ccode\u003enextval\u003c/code\u003e 的插入是真实的重复键触发；\u003ccode\u003esetval\u003c/code\u003e 后又执行了一次真实插入，以验证修复后的下一个值。\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003eCREATE SEQUENCE ids_seq START WITH 100 INCREMENT BY 7 MINVALUE 100 MAXVALUE 100000;\nCREATE TABLE items(id integer PRIMARY KEY, note text);\nINSERT INTO items(id,note) VALUES (100, 'explicit');\nINSERT INTO items(id,note) VALUES (nextval('ids_seq'), 'generated');\nSELECT setval('ids_seq', (SELECT max(id) FROM items), true);\nINSERT INTO items(id,note) VALUES (nextval('ids_seq'), 'after repair');\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003e受控 \u003ccode\u003esetval\u003c/code\u003e 后下一值为 107。这种修复有明确前提：暂停写入者，确认序列身份和所有关系，空表不能传入无效值，并检查 increment、边界、cache 和 \u003ccode\u003eis_called\u003c/code\u003e。\u003ccode\u003esetval\u003c/code\u003e 不是通用的并发修复；序列变更也不会像普通表写入那样回滚。\u003c/p\u003e\n\u003ch3\u003e只有在操作可重试时才重试\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"/docs/18/mvcc-serialization-failure-handling.html\"\u003e序列化失败处理文档\u003c/a\u003e 说明了某些并发选择键的场景可能以 \u003ccode\u003e23505\u003c/code\u003e 呈现。应用确认属于这种语义后，应重试完整事务（包括选择键的逻辑），并配合有界退避和幂等策略。不要盲目重试：用户明确请求的重复可能是永久条件，反复尝试也可能得到同一冲突。\u003c/p\u003e\n\u003cp\u003e双会话案例证明了锁顺序建立后会出现冲突，但运行器没有声称所有相同状态码的业务操作都可以安全重试。\u003c/p\u003e\n\u003ch3\u003e处理并发索引构建失败（案例：\u003ccode\u003eindex_build_conflict\u003c/code\u003e）\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"/docs/18/sql-createindex.html\"\u003eCREATE INDEX 文档\u003c/a\u003e 说明，如果并发构建的扫描遇到唯一性失败等问题，可能留下 \u003ccode\u003eINVALID\u003c/code\u003e 索引。在本次重复扫描案例中，\u003ccode\u003epg_index\u003c/code\u003e 显示 \u003ccode\u003eindisvalid=false\u003c/code\u003e、\u003ccode\u003eindisready=false\u003c/code\u003e、\u003ccode\u003eindislive=true\u003c/code\u003e、\u003ccode\u003eindisunique=true\u003c/code\u003e；普通事务性构建回滚后没有留下索引。解决重复数据后检查实际目录状态，适当时删除遗留的无效索引，再重新构建。不要把这一状态推广到 \u003ccode\u003eCREATE INDEX CONCURRENTLY\u003c/code\u003e 的所有失败阶段。\u003c/p\u003e"},{"anchor":"versions","heading":"版本与边界","html":"\u003cp\u003ePostgreSQL 10.21 和 18.6 都实际观察到了相同 SQLSTATE。两版源码行号和内部函数名不同；兼容性判断应使用 SQLSTATE 与操作上下文，而不是使用源码行号。\u003c/p\u003e\n\u003cp\u003e\u003ccode\u003eUNIQUE NULLS NOT DISTINCT\u003c/code\u003e 在 PostgreSQL 15 及以后可用，且必须显式选择。运行案例向默认唯一列插入两个 NULL 成功；向单独声明的 \u003ccode\u003eUNIQUE NULLS NOT DISTINCT\u003c/code\u003e 约束插入第二个 NULL 时产生 \u003ccode\u003e23505\u003c/code\u003e。升级不会默默把旧约束的默认语义改成 NULLS NOT DISTINCT。\u003c/p\u003e\n\u003cp\u003e单独的版本边界对照已经实际记录了可用性和行为：PostgreSQL 14.24 接受普通唯一列的两个 NULL，但显式声明因 \u003ccode\u003e42601\u003c/code\u003e 拒绝且没有 \u003ccode\u003e23505\u003c/code\u003e；PostgreSQL 15.19 在显式约束的第二个 NULL 上产生 \u003ccode\u003e23505\u003c/code\u003e，自动提交会话保持 \u003ccode\u003eIDLE\u003c/code\u003e，并成功提交有效值修复。这些记录单独保留，不增加基础选定案例数量。在其他临时目标上执行时，应先检查版本并按分支运行：先执行 \u003ccode\u003eordinary_create\u003c/code\u003e、\u003ccode\u003eordinary_first\u003c/code\u003e、\u003ccode\u003eordinary_second\u003c/code\u003e、\u003ccode\u003eordinary_verify\u003c/code\u003e，再执行 \u003ccode\u003eexplicit_create\u003c/code\u003e；如果得到 PG14 预期的 \u003ccode\u003e42601\u003c/code\u003e，就在这里停止，不要发送 \u003ccode\u003eexplicit_first\u003c/code\u003e、\u003ccode\u003eexplicit_second\u003c/code\u003e、\u003ccode\u003eexplicit_repair\u003c/code\u003e 或 \u003ccode\u003eexplicit_verify\u003c/code\u003e。只有 \u003ccode\u003eexplicit_create\u003c/code\u003e 在 PG15 或更高版本成功后，才继续显式插入、观察第二个 NULL 的结果，再执行修复和验证。\u003c/p\u003e\n\u003cpre\u003e\u003ccode class=\"language-sql\"\u003e-- ordinary_create\nCREATE TABLE ordinary_nulls (external_id integer UNIQUE);\n-- ordinary_first\nINSERT INTO ordinary_nulls VALUES (NULL);\n-- ordinary_second\nINSERT INTO ordinary_nulls VALUES (NULL);\n-- ordinary_verify\nSELECT count(*) FROM ordinary_nulls;\n-- explicit_create\nCREATE TABLE explicit_nulls (external_id integer, CONSTRAINT nulls_not_distinct_uq UNIQUE NULLS NOT DISTINCT (external_id));\n-- explicit_first\nINSERT INTO explicit_nulls VALUES (NULL);\n-- explicit_second\nINSERT INTO explicit_nulls VALUES (NULL);\n-- explicit_repair\nINSERT INTO explicit_nulls VALUES (1);\n-- explicit_verify\nSELECT count(*) FROM explicit_nulls;\n\u003c/code\u003e\u003c/pre\u003e\n\u003cp\u003ePostgreSQL 18 的逻辑冲突报告器使用 \u003ccode\u003einsert_exists\u003c/code\u003e 等标签。消息改变并不意味着相关唯一冲突换成了别的 SQLSTATE。本批证据来自源码和文档；运行报告没有声称测试了复制拓扑。\u003c/p\u003e\n\u003cp\u003e锁定目录在 PostgreSQL 7.4 的定义中已观察到 \u003ccode\u003e23505\u003c/code\u003e，并持续到 8.4.22 的 pre-9.0 定义；随后在列出的所有正式快照直到 PostgreSQL 18.6 以及 PostgreSQL 19 Beta 3 预览中存在。这是 definition_only 的存在边界，不是确切实现引入版本或运行时使用断言。\u003c/p\u003e"},{"anchor":"related","heading":"相关代码","html":"\u003cul\u003e\n\u003cli\u003e\u003ca href=\"/wiki/sqlstate/25P02/\"\u003e\u003ccode\u003e25P02\u003c/code\u003e — in_failed_sql_transaction\u003c/a\u003e 说明显式事务中未处理语句失败后的后续错误。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/wiki/sqlstate/40001/\"\u003e\u003ccode\u003e40001\u003c/code\u003e — serialization_failure\u003c/a\u003e 与 \u003ca href=\"/wiki/sqlstate/40P01/\"\u003e\u003ccode\u003e40P01\u003c/code\u003e — deadlock_detected\u003c/a\u003e 是主要的事务重试相关错误；PostgreSQL 也记录了特定的 \u003ccode\u003e23505\u003c/code\u003e 键选择竞态。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/wiki/sqlstate/23503/\"\u003e\u003ccode\u003e23503\u003c/code\u003e — foreign_key_violation\u003c/a\u003e 也是 Class 23 完整性错误，但缺少被引用行的诊断和修复步骤不同。\u003c/li\u003e\n\u003c/ul\u003e"},{"anchor":"sources","heading":"来源与证据","html":"\u003cp\u003e本页使用的证据 ID 是\u003ca href=\"#sources\"\u003e公开证据 JSON\u003c/a\u003e中的 \u003ccode\u003eidentity.class-and-condition\u003c/code\u003e、\u003ccode\u003eruntime.dml-template\u003c/code\u003e、\u003ccode\u003eruntime.protocol-fields\u003c/code\u003e、\u003ccode\u003eruntime.index-build-template\u003c/code\u003e、\u003ccode\u003eruntime.logical-apply-sqlstate\u003c/code\u003e、\u003ccode\u003eruntime.tx-contexts\u003c/code\u003e、\u003ccode\u003eruntime.retry-boundary\u003c/code\u003e、\u003ccode\u003eruntime.on-conflict-scope\u003c/code\u003e、\u003ccode\u003eruntime.sequence-repair-limit\u003c/code\u003e、\u003ccode\u003eruntime.nulls-choice\u003c/code\u003e、\u003ccode\u003eruntime.detail-visibility\u003c/code\u003e 和 \u003ccode\u003eruntime.version-boundary\u003c/code\u003e。选定的运行记录对未替代案例使用完整运行，对 DML 使用 \u003ccode\u003e23505-diagnostic-snippet-20260909\u003c/code\u003e，对精确 collector 关联使用 \u003ccode\u003e23505-log-fields-final-20260909\u003c/code\u003e，对 registry 片段使用 \u003ccode\u003e23505-snippet-contract-20260909\u003c/code\u003e，对显式事务和保存点恢复使用 manual-boundary run。单独的边界记录是 \u003ccode\u003eruntime.23505-boundary-pg14-20260909.pg14\u003c/code\u003e 和 \u003ccode\u003eruntime.23505-boundary-pg15-20260909.pg15\u003c/code\u003e，用于版本对照，不增加基础案例数量。被替代的完整运行选择仅保留为本地审计数据。\u003c/p\u003e\n\u003cul\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/errcodes.txt#L235-L241\"\u003e固定源码提交中的 PostgreSQL 18.6 \u003ccode\u003eerrcodes.txt\u003c/code\u003e\u003c/a\u003e —— Class 23 与 \u003ccode\u003eunique_violation\u003c/code\u003e 身份。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtinsert.c#L640-L674\"\u003e固定源码提交中的 PostgreSQL 18.6 nbtree 唯一性检查\u003c/a\u003e —— DML 报文与协议对象字段。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/index/genam.c#L155-L275\"\u003e固定源码提交中的 PostgreSQL 18.6 索引值描述\u003c/a\u003e —— detail 可见性限制。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/sort/tuplesortvariants.c#L1670-L1694\"\u003e固定源码提交中的 PostgreSQL 18.6 索引构建错误\u003c/a\u003e —— 独立的构建报文模板。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/replication/logical/conflict.c#L102-L180\"\u003e固定源码提交中的 PostgreSQL 18.6 逻辑冲突报告器\u003c/a\u003e —— 应用标签和 SQLSTATE 映射。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/docs/18/sql-insert.html\"\u003eINSERT 命令参考\u003c/a\u003e —— 冲突目标范围和 arbiter 限制。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/docs/18/sql-createindex.html\"\u003eCREATE INDEX 命令参考\u003c/a\u003e —— 并发构建阶段和无效索引行为。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/docs/18/protocol-error-fields.html\"\u003eError and Notice Message Fields\u003c/a\u003e 与 \u003ca href=\"/docs/18/runtime-config-logging.html\"\u003e服务器日志配置\u003c/a\u003e —— 协议字段与 collector 字段的区别。\u003c/li\u003e\n\u003cli\u003e\u003ca href=\"/docs/18/plpgsql-control-structures.html\"\u003ePL/pgSQL 控制结构\u003c/a\u003e、\u003ca href=\"/docs/18/tutorial-transactions.html\"\u003e事务教程\u003c/a\u003e 和\u003ca href=\"/docs/18/functions-sequence.html\"\u003e序列函数\u003c/a\u003e —— 恢复与受控修复语义。\u003c/li\u003e\n\u003c/ul\u003e"}],"summary":"行或索引违反唯一约束，常见于重复键插入。","title":"23505 — unique_violation：唯一性冲突","translation_source_rev":"6852958e8b9926fc71c1258c68afedd3883ff869f8d677400e098b98d1aebf00"}},"RequestedLocale":"zh-Hans","Fallback":false,"Versions":["10","11","12","13","14","15","16","17","18","19","20","8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6"],"Locales":["en","zh-Hans"],"Signatures":null,"Spellings":null,"SQLState":{"aliases":[],"catalogue_notes":{"earliest_observed":"7.4","formal_scope":"9.0.0..18.6","latest_observed":"18.6","matrix_scope":["9.0.23","9.1.24","9.2.24","9.3.25","9.4.26","9.5.25","9.6.24","10.23","11.22","12.22","13.23","14.24","15.19","16.15","17.11","18.6"],"pre9_scope":{"formal_tag_count":191,"maximum_release":"8.4.22","minimum_release":"7.0.0","source_definition_count":153,"source_doc_count":153,"source_file_count":306,"source_scope":"7.4..8.4 definition files; 7.0..7.3 candidate-path source gap probes","source_tag_count":153},"pre9_status":"present","preview_scope":["19beta3"]},"class":"23","class_name":"Integrity Constraint Violation","condition_name":"unique_violation","condition_names":["unique_violation"],"definition_changes":[],"english_manuals":{"10":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"9607b57e9f639b61785677ba4d226f5889fe1d19c8bf55a3337691899a9073cd","slug":"10"},"lang":"en","sqlstate":"23505"},"11":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"3a024e38263ad77de228eed7930b842b42dc1d5cab9ca3727be8eed872ec9539","slug":"11"},"lang":"en","sqlstate":"23505"},"12":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"1444bd6a138537cd75be88a220ee9472ac528f0cfc58758e49636d85455efe98","slug":"12"},"lang":"en","sqlstate":"23505"},"13":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"4a3ef8af218e5736dfde8660ba609e84233b6b3bac7e0210ff8724cf1b27b2db","slug":"13"},"lang":"en","sqlstate":"23505"},"14":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"1c12e83304e0f4ff64c9d98ca5e3007df6756932ed19867a4fa0e0650f6c5751","slug":"14"},"lang":"en","sqlstate":"23505"},"15":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"2161f58f6e87f6535b3b1f3d4661427bb6765f4f6b074fcc16fac97594b50599","slug":"15"},"lang":"en","sqlstate":"23505"},"16":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"928e705933d7c3d018ae3fba9d800b34e6325746d157339dce878473c519d100","slug":"16"},"lang":"en","sqlstate":"23505"},"17":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"868135520af87351e3ea1ba42656111cbd2d157d98e1fef05ea158ac5729d8b1","slug":"17"},"lang":"en","sqlstate":"23505"},"18":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"56dacf78e618ff0fd8c533e05db597b80d7ebbad7f8e512a888217d0640aa328","slug":"18"},"lang":"en","sqlstate":"23505"},"19":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"63fb8d1aa9f494eeab9d0f8542a2b673f7746ee41ae2689d19403cb3cc425a5c","slug":"19"},"lang":"en","sqlstate":"23505"},"20":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"0d3f602127cd137cf343b32d5fa78f175eeb6cdcb6353b1f6f998ede6cb7b911","slug":"devel"},"lang":"en","sqlstate":"23505"},"8.1":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"0177b8818643540dec7bbef1fe92b60a3961debd52a68412301647ca146c7f2d","slug":"8.1"},"lang":"en","sqlstate":"23505"},"8.2":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"d65bf7cff5958c304352c974e477183e21efe9bd68e03786001874653bf66963","slug":"8.2"},"lang":"en","sqlstate":"23505"},"8.3":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"118059002973cdec5466ed3cabe7c9370b4c93d8ab542b8661d0eeb50cf6950d","slug":"8.3"},"lang":"en","sqlstate":"23505"},"8.4":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"d63b10001be0581484022e33b78124a36bb3bd68d3ebe022cd7dfb375233432f","slug":"8.4"},"lang":"en","sqlstate":"23505"},"9.0":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"658fc09c4c10eed7ac7dea4ed3e3eff8cc5791eb5af26b7b4a31b0f863b316db","slug":"9.0"},"lang":"en","sqlstate":"23505"},"9.1":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"2d118b06c3b644c28b3ddefe9e4bef99a180321582209332372a5318f5bf8d1c","slug":"9.1"},"lang":"en","sqlstate":"23505"},"9.2":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"2a37575b39c858d37c58fc4de6a16109554fd3306602294180d78faa1170d2cd","slug":"9.2"},"lang":"en","sqlstate":"23505"},"9.3":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"2214b6869d764f7fba7221aefcdf1ab049b55ad51d63aa52054f3cd2c2533ae9","slug":"9.3"},"lang":"en","sqlstate":"23505"},"9.4":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"7243e2d653befe88733222ede67958f0c4b7fae967b58eb97807aeb3f32b4096","slug":"9.4"},"lang":"en","sqlstate":"23505"},"9.5":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"d40bc67cb331f1e4ccc0821ff57832c6c230edb0dce3ba4249defd21ae7ea29d","slug":"9.5"},"lang":"en","sqlstate":"23505"},"9.6":{"aliases":[],"class_name":"Integrity Constraint Violation","condition_name":"unique_violation","doc":{"anchor":"ERRCODES-APPENDIX","file":"errcodes-appendix.html","lang":"en","sha256":"2ab55e487571c8998ec39b3d1bbae29ac6fc5c310875bee422d9a7b8b3fde5b3","slug":"9.6"},"lang":"en","sqlstate":"23505"}},"history_boundary":{"earliest_observed":"7.4","formal_tag_count":351,"gaps":[{"after":"18.6","before":"18.4","reason":"Non-adjacent release tags or a source gap; no removal is inferred."}],"latest_observed":"18.6","pre_range":{"first_observed":"7.4","known_lower_bound":"7.4 or earlier","last_observed":"8.4.22","notes":"Observed in the locked pre-9 formal release source; the label is a proven presence bound, not an exact introduction commit. Candidate source gaps remain for majors 7.0, 7.1, 7.2, 7.3.","scanned_formal_release_count":153,"scanned_source_scope":"7.4..8.4 definition files; 7.0..7.3 candidate-path source gap probes","source_gap_majors":["7.0","7.1","7.2","7.3"],"status":"partially_scanned"},"preview_snapshots":["19beta3"],"scanned_from":"9.0.0","scanned_to":"18.6"},"introduced":null,"known_present_by":"7.4","macros":["ERRCODE_UNIQUE_VIOLATION"],"manual_presence":["8.1","8.2","8.3","8.4","9.0","9.1","9.2","9.3","9.4","9.5","9.6","10","11","12","13","14","15","16","17","18","19","20"],"pre9_first_observed":"7.4","pre9_introduction_boundary":null,"pre9_last_observed":"8.4.22","pre9_presence_intervals":[{"end":"7.4.30","end_major":"7.4","end_tag":"REL7_4_30","evidence_count":31,"position":0,"start":"7.4","start_major":"7.4","start_tag":"REL7_4"},{"end":"8.0.26","end_major":"8.0","end_tag":"REL8_0_26","evidence_count":27,"position":1,"start":"8.0.0","start_major":"8.0","start_tag":"REL8_0_0"},{"end":"8.1.23","end_major":"8.1","end_tag":"REL8_1_23","evidence_count":24,"position":2,"start":"8.1.0","start_major":"8.1","start_tag":"REL8_1_0"},{"end":"8.2.23","end_major":"8.2","end_tag":"REL8_2_23","evidence_count":24,"position":3,"start":"8.2.0","start_major":"8.2","start_tag":"REL8_2_0"},{"end":"8.3.23","end_major":"8.3","end_tag":"REL8_3_23","evidence_count":24,"position":4,"start":"8.3.0","start_major":"8.3","start_tag":"REL8_3_0"},{"end":"8.4.22","end_major":"8.4","end_tag":"REL8_4_22","evidence_count":23,"position":5,"start":"8.4.0","start_major":"8.4","start_tag":"REL8_4_0"}],"pre9_status":"present","presence_intervals":[{"end":"9.0.23","end_major":"9.0","end_tag":"REL9_0_23","evidence_count":24,"position":0,"start":"9.0.0","start_major":"9.0","start_tag":"REL9_0_0"},{"end":"9.1.24","end_major":"9.1","end_tag":"REL9_1_24","evidence_count":25,"position":1,"start":"9.1.0","start_major":"9.1","start_tag":"REL9_1_0"},{"end":"9.2.24","end_major":"9.2","end_tag":"REL9_2_24","evidence_count":25,"position":2,"start":"9.2.0","start_major":"9.2","start_tag":"REL9_2_0"},{"end":"9.3.25","end_major":"9.3","end_tag":"REL9_3_25","evidence_count":26,"position":3,"start":"9.3.0","start_major":"9.3","start_tag":"REL9_3_0"},{"end":"9.4.26","end_major":"9.4","end_tag":"REL9_4_26","evidence_count":27,"position":4,"start":"9.4.0","start_major":"9.4","start_tag":"REL9_4_0"},{"end":"9.5.25","end_major":"9.5","end_tag":"REL9_5_25","evidence_count":26,"position":5,"start":"9.5.0","start_major":"9.5","start_tag":"REL9_5_0"},{"end":"9.6.24","end_major":"9.6","end_tag":"REL9_6_24","evidence_count":25,"position":6,"start":"9.6.0","start_major":"9.6","start_tag":"REL9_6_0"},{"end":"10.23","end_major":"10","end_tag":"REL_10_23","evidence_count":24,"position":7,"start":"10.0","start_major":"10","start_tag":"REL_10_0"},{"end":"11.22","end_major":"11","end_tag":"REL_11_22","evidence_count":23,"position":8,"start":"11.0","start_major":"11","start_tag":"REL_11_0"},{"end":"12.22","end_major":"12","end_tag":"REL_12_22","evidence_count":23,"position":9,"start":"12.0","start_major":"12","start_tag":"REL_12_0"},{"end":"13.23","end_major":"13","end_tag":"REL_13_23","evidence_count":24,"position":10,"start":"13.0","start_major":"13","start_tag":"REL_13_0"},{"end":"14.24","end_major":"14","end_tag":"REL_14_24","evidence_count":25,"position":11,"start":"14.0","start_major":"14","start_tag":"REL_14_0"},{"end":"15.19","end_major":"15","end_tag":"REL_15_19","evidence_count":20,"position":12,"start":"15.0","start_major":"15","start_tag":"REL_15_0"},{"end":"16.15","end_major":"16","end_tag":"REL_16_15","evidence_count":16,"position":13,"start":"16.0","start_major":"16","start_tag":"REL_16_0"},{"end":"17.11","end_major":"17","end_tag":"REL_17_11","evidence_count":12,"position":14,"start":"17.0","start_major":"17","start_tag":"REL_17_0"},{"end":"18.4","end_major":"18","end_tag":"REL_18_4","evidence_count":5,"position":15,"start":"18.0","start_major":"18","start_tag":"REL_18_0"},{"end":"18.6","end_major":"18","end_tag":"REL_18_6","evidence_count":1,"position":16,"start":"18.6","start_major":"18","start_tag":"REL_18_6"}],"present_in_snapshots":["9.0.23","9.1.24","9.2.24","9.3.25","9.4.26","9.5.25","9.6.24","10.23","11.22","12.22","13.23","14.24","15.19","16.15","17.11","18.6","19beta3"],"preview_in_snapshots":["19beta3"],"primary_macro":"ERRCODE_UNIQUE_VIOLATION","removed":null,"schema_version":2,"severity_classes":["E"],"sources":[{"channel":"formal","code_count":0,"commit":"3f78df10b168b78232fdbefe1d9d84c37f5aaaab","id":"postgresql:REL7_4:src/include/utils/errcodes.h","major":"7.4","path":"src/include/utils/errcodes.h","raw_path":".cache/catalogue/pre9/raw/definition/REL7_4.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/3f78df10b168b78232fdbefe1d9d84c37f5aaaab/src/include/utils/errcodes.h","record_count":0,"release":"7.4","repository":"https://github.com/postgres/postgres.git","sha256":"85e0d54037f0c49a06c909a4908fa24c19734c08f7f9611e5fbeb1b39745a539","size":18146,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL7_4","url":"https://github.com/postgres/postgres/blob/3f78df10b168b78232fdbefe1d9d84c37f5aaaab/src/include/utils/errcodes.h","version":"7.4"},{"channel":"formal","code_count":0,"commit":"c22b7eccd368754ea96865c046764382ab05db4b","id":"postgresql:REL8_0_0:src/include/utils/errcodes.h","major":"8.0","path":"src/include/utils/errcodes.h","raw_path":".cache/catalogue/pre9/raw/definition/REL8_0_0.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/c22b7eccd368754ea96865c046764382ab05db4b/src/include/utils/errcodes.h","record_count":0,"release":"8.0.0","repository":"https://github.com/postgres/postgres.git","sha256":"8b928e18943235ff0543eab22189ade1a018de43d72275f28b79df7d14e47849","size":20020,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL8_0_0","url":"https://github.com/postgres/postgres/blob/c22b7eccd368754ea96865c046764382ab05db4b/src/include/utils/errcodes.h","version":"8.0.0"},{"channel":"formal","code_count":0,"commit":"2a80c3c4dc56a44a26805c889ef71b614e769266","id":"postgresql:REL8_1_0:src/include/utils/errcodes.h","major":"8.1","path":"src/include/utils/errcodes.h","raw_path":".cache/catalogue/pre9/raw/definition/REL8_1_0.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/2a80c3c4dc56a44a26805c889ef71b614e769266/src/include/utils/errcodes.h","record_count":0,"release":"8.1.0","repository":"https://github.com/postgres/postgres.git","sha256":"52cab83d60a3b5fec10786b65bbfba39ef7404bc0e4599f6c239f2b56ad6a8ed","size":20109,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL8_1_0","url":"https://github.com/postgres/postgres/blob/2a80c3c4dc56a44a26805c889ef71b614e769266/src/include/utils/errcodes.h","version":"8.1.0"},{"channel":"formal","code_count":0,"commit":"2f52d7260ceac8e57613516d82a7404fbf3d137b","id":"postgresql:REL8_2_0:src/include/utils/errcodes.h","major":"8.2","path":"src/include/utils/errcodes.h","raw_path":".cache/catalogue/pre9/raw/definition/REL8_2_0.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/2f52d7260ceac8e57613516d82a7404fbf3d137b/src/include/utils/errcodes.h","record_count":0,"release":"8.2.0","repository":"https://github.com/postgres/postgres.git","sha256":"1f13bd962e663bf5222198a4b30fb016f1f21141b2c4ed2be351595ecf04f269","size":20247,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL8_2_0","url":"https://github.com/postgres/postgres/blob/2f52d7260ceac8e57613516d82a7404fbf3d137b/src/include/utils/errcodes.h","version":"8.2.0"},{"channel":"formal","code_count":0,"commit":"9e647a13872a5f34dc0009566925c5c352463780","id":"postgresql:REL8_3_0:src/include/utils/errcodes.h","major":"8.3","path":"src/include/utils/errcodes.h","raw_path":".cache/catalogue/pre9/raw/definition/REL8_3_0.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/9e647a13872a5f34dc0009566925c5c352463780/src/include/utils/errcodes.h","record_count":0,"release":"8.3.0","repository":"https://github.com/postgres/postgres.git","sha256":"8df5862003e7906ea11cf626431a426d1c7ae65d4fb85e526a46e29059b8e346","size":20650,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL8_3_0","url":"https://github.com/postgres/postgres/blob/9e647a13872a5f34dc0009566925c5c352463780/src/include/utils/errcodes.h","version":"8.3.0"},{"channel":"formal","code_count":0,"commit":"4d53a2f9699547bdc12831d2860c9d44c465e805","id":"postgresql:REL8_4_0:src/include/utils/errcodes.h","major":"8.4","path":"src/include/utils/errcodes.h","raw_path":".cache/catalogue/pre9/raw/definition/REL8_4_0.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/4d53a2f9699547bdc12831d2860c9d44c465e805/src/include/utils/errcodes.h","record_count":0,"release":"8.4.0","repository":"https://github.com/postgres/postgres.git","sha256":"b1a08b6c8e85631fe7a849d531841247a641bb799bca739c929a78e6702d3ab4","size":21169,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL8_4_0","url":"https://github.com/postgres/postgres/blob/4d53a2f9699547bdc12831d2860c9d44c465e805/src/include/utils/errcodes.h","version":"8.4.0"},{"channel":"formal","code_count":0,"commit":"8dd387500abe58a684c559f20c26ac08884b0c5d","id":"postgresql:REL8_4_22:src/include/utils/errcodes.h","major":"8.4","path":"src/include/utils/errcodes.h","raw_path":".cache/catalogue/pre9/raw/definition/REL8_4_22.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/8dd387500abe58a684c559f20c26ac08884b0c5d/src/include/utils/errcodes.h","record_count":0,"release":"8.4.22","repository":"https://github.com/postgres/postgres.git","sha256":"43fd9924243ff5bb5f51b5e7a5e5d8a011458beb5bb669b1d5b6122dac515936","size":21170,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL8_4_22","url":"https://github.com/postgres/postgres/blob/8dd387500abe58a684c559f20c26ac08884b0c5d/src/include/utils/errcodes.h","version":"8.4.22"},{"blob_id":"sha256:c814fbe5a5d2a61abe5bcf5c7754a9d339664aa4ee73f46fa11ed14966ff6713","channel":"formal","code_count":198,"commit":"861861edcc04a6e3ebdfe363311f122e2b226196","id":"postgresql:REL9_0_0:src/include/utils/errcodes.h","major":"9.0","parsed_path":"raw/definitions/REL9_0_0.parsed.json","path":"src/include/utils/errcodes.h","raw_path":"raw/definitions/REL9_0_0.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/861861edcc04a6e3ebdfe363311f122e2b226196/src/include/utils/errcodes.h","record_count":204,"release":"9.0.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"c814fbe5a5d2a61abe5bcf5c7754a9d339664aa4ee73f46fa11ed14966ff6713","size":21313,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL9_0_0","url":"https://github.com/postgres/postgres/blob/861861edcc04a6e3ebdfe363311f122e2b226196/src/include/utils/errcodes.h","version":"9.0.0"},{"blob_id":"sha256:e23d5129578249fc242f2737be2a577d6714b57917aad9deaf5ec156cadc52fd","channel":"formal","code_count":199,"commit":"ffb39e1aedcdd7b77ec920221b27ab02c40ddbfc","id":"postgresql:REL9_0_4:src/include/utils/errcodes.h","major":"9.0","parsed_path":"raw/definitions/REL9_0_4.parsed.json","path":"src/include/utils/errcodes.h","raw_path":"raw/definitions/REL9_0_4.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/ffb39e1aedcdd7b77ec920221b27ab02c40ddbfc/src/include/utils/errcodes.h","record_count":205,"release":"9.0.4","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"e23d5129578249fc242f2737be2a577d6714b57917aad9deaf5ec156cadc52fd","size":21384,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL9_0_4","url":"https://github.com/postgres/postgres/blob/ffb39e1aedcdd7b77ec920221b27ab02c40ddbfc/src/include/utils/errcodes.h","version":"9.0.4"},{"blob_id":"sha256:5b77881aab6f0d659fb3295e1adf53799a02c3d5680200bb10ff9f15d741f924","channel":"formal","code_count":199,"commit":"391aa8aac11fe78f3b2f5743b56e78b0ad6a5d84","id":"postgresql:REL9_0_18:src/include/utils/errcodes.h","major":"9.0","parsed_path":"raw/definitions/REL9_0_18.parsed.json","path":"src/include/utils/errcodes.h","raw_path":"raw/definitions/REL9_0_18.h","raw_url":"https://raw.githubusercontent.com/postgres/postgres/391aa8aac11fe78f3b2f5743b56e78b0ad6a5d84/src/include/utils/errcodes.h","record_count":205,"release":"9.0.18","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"5b77881aab6f0d659fb3295e1adf53799a02c3d5680200bb10ff9f15d741f924","size":21385,"source_format":"errcodes.h","source_role":"primary_definition","tag":"REL9_0_18","url":"https://github.com/postgres/postgres/blob/391aa8aac11fe78f3b2f5743b56e78b0ad6a5d84/src/include/utils/errcodes.h","version":"9.0.18"},{"blob_id":"sha256:2b1d71c453a82488c4e95df84a9ee18dc8fdcb2532a7c56f44f1e8c4265a8132","channel":"formal","code_count":228,"commit":"1f43001424a9da624a89b213d0be606a8212a50a","id":"postgresql:REL9_1_0:src/backend/utils/errcodes.txt","major":"9.1","parsed_path":"raw/definitions/REL9_1_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL9_1_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/1f43001424a9da624a89b213d0be606a8212a50a/src/backend/utils/errcodes.txt","record_count":234,"release":"9.1.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"2b1d71c453a82488c4e95df84a9ee18dc8fdcb2532a7c56f44f1e8c4265a8132","size":29355,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL9_1_0","url":"https://github.com/postgres/postgres/blob/1f43001424a9da624a89b213d0be606a8212a50a/src/backend/utils/errcodes.txt","version":"9.1.0"},{"blob_id":"sha256:271a522fcd18ec45ebe4c1235af0e27a0e9bf0376fda4073b9f4a9c0a00fc711","channel":"formal","code_count":232,"commit":"ef47adb414e46099155c34529a2a5caeea02fc41","id":"postgresql:REL9_2_0:src/backend/utils/errcodes.txt","major":"9.2","parsed_path":"raw/definitions/REL9_2_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL9_2_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/ef47adb414e46099155c34529a2a5caeea02fc41/src/backend/utils/errcodes.txt","record_count":238,"release":"9.2.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"271a522fcd18ec45ebe4c1235af0e27a0e9bf0376fda4073b9f4a9c0a00fc711","size":30387,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL9_2_0","url":"https://github.com/postgres/postgres/blob/ef47adb414e46099155c34529a2a5caeea02fc41/src/backend/utils/errcodes.txt","version":"9.2.0"},{"blob_id":"sha256:f90d801e724191c84e94ae33483e71b4e3c4de5730474d316df4c722a149897d","channel":"formal","code_count":232,"commit":"da645b3a73580ac30cf02e932b42d06157b98229","id":"postgresql:REL9_3_0:src/backend/utils/errcodes.txt","major":"9.3","parsed_path":"raw/definitions/REL9_3_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL9_3_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/da645b3a73580ac30cf02e932b42d06157b98229/src/backend/utils/errcodes.txt","record_count":238,"release":"9.3.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"f90d801e724191c84e94ae33483e71b4e3c4de5730474d316df4c722a149897d","size":30387,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL9_3_0","url":"https://github.com/postgres/postgres/blob/da645b3a73580ac30cf02e932b42d06157b98229/src/backend/utils/errcodes.txt","version":"9.3.0"},{"blob_id":"sha256:1695ec274fb29f0b0875ff674405e775334243835a6f6008e007dfe3a8260bf5","channel":"formal","code_count":232,"commit":"8ca336f4ac3f08a5f23e76c6e9a5f2c8064f5883","id":"postgresql:REL9_4_0:src/backend/utils/errcodes.txt","major":"9.4","parsed_path":"raw/definitions/REL9_4_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL9_4_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/8ca336f4ac3f08a5f23e76c6e9a5f2c8064f5883/src/backend/utils/errcodes.txt","record_count":238,"release":"9.4.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"1695ec274fb29f0b0875ff674405e775334243835a6f6008e007dfe3a8260bf5","size":30387,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL9_4_0","url":"https://github.com/postgres/postgres/blob/8ca336f4ac3f08a5f23e76c6e9a5f2c8064f5883/src/backend/utils/errcodes.txt","version":"9.4.0"},{"blob_id":"sha256:37f728a7e034ef0b05b060a4b82c7dd95c900e4a5501c80bfefd8d679889253b","channel":"formal","code_count":236,"commit":"cdd4ed5449bf317cc71b45a8deee0173822e7592","id":"postgresql:REL9_5_0:src/backend/utils/errcodes.txt","major":"9.5","parsed_path":"raw/definitions/REL9_5_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL9_5_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/cdd4ed5449bf317cc71b45a8deee0173822e7592/src/backend/utils/errcodes.txt","record_count":242,"release":"9.5.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"37f728a7e034ef0b05b060a4b82c7dd95c900e4a5501c80bfefd8d679889253b","size":30798,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL9_5_0","url":"https://github.com/postgres/postgres/blob/cdd4ed5449bf317cc71b45a8deee0173822e7592/src/backend/utils/errcodes.txt","version":"9.5.0"},{"blob_id":"sha256:bf4d94d84c7cfe695cb80e8f009872444574719a80a72e347eb66ef3686b86ef","channel":"formal","code_count":238,"commit":"a721a1ba9cf6c86cb52f1bf325d5a27b64e870d6","id":"postgresql:REL9_6_0:src/backend/utils/errcodes.txt","major":"9.6","parsed_path":"raw/definitions/REL9_6_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL9_6_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/a721a1ba9cf6c86cb52f1bf325d5a27b64e870d6/src/backend/utils/errcodes.txt","record_count":244,"release":"9.6.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"bf4d94d84c7cfe695cb80e8f009872444574719a80a72e347eb66ef3686b86ef","size":31135,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL9_6_0","url":"https://github.com/postgres/postgres/blob/a721a1ba9cf6c86cb52f1bf325d5a27b64e870d6/src/backend/utils/errcodes.txt","version":"9.6.0"},{"blob_id":"sha256:e5d829b24fe63aa69429fa1deb9675051fc8ffd4a8a4651861907a8f12ccb144","channel":"formal","code_count":240,"commit":"5df0e99bea1c3e5fbffa7fbd0982da88ea149bb6","id":"postgresql:REL_10_0:src/backend/utils/errcodes.txt","major":"10","parsed_path":"raw/definitions/REL_10_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_10_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/5df0e99bea1c3e5fbffa7fbd0982da88ea149bb6/src/backend/utils/errcodes.txt","record_count":246,"release":"10.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"e5d829b24fe63aa69429fa1deb9675051fc8ffd4a8a4651861907a8f12ccb144","size":31340,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_10_0","url":"https://github.com/postgres/postgres/blob/5df0e99bea1c3e5fbffa7fbd0982da88ea149bb6/src/backend/utils/errcodes.txt","version":"10.0"},{"blob_id":"sha256:8518be6de92ae135765e295c631c5f525120ca2b132453404b620f9aa595cab4","channel":"formal","code_count":241,"commit":"19f20081df059fef87e14c8e953669bd173dd7f1","id":"postgresql:REL_11_0:src/backend/utils/errcodes.txt","major":"11","parsed_path":"raw/definitions/REL_11_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_11_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/19f20081df059fef87e14c8e953669bd173dd7f1/src/backend/utils/errcodes.txt","record_count":247,"release":"11.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"8518be6de92ae135765e295c631c5f525120ca2b132453404b620f9aa595cab4","size":31453,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_11_0","url":"https://github.com/postgres/postgres/blob/19f20081df059fef87e14c8e953669bd173dd7f1/src/backend/utils/errcodes.txt","version":"11.0"},{"blob_id":"sha256:943259f3e36af1343dd0f090f7c7cec0e8c762b038d68c178aaa9b1b11999bfb","channel":"formal","code_count":257,"commit":"ad1f2885b8c82e0c2d56d7974f012cbecce17a17","id":"postgresql:REL_12_0:src/backend/utils/errcodes.txt","major":"12","parsed_path":"raw/definitions/REL_12_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_12_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/ad1f2885b8c82e0c2d56d7974f012cbecce17a17/src/backend/utils/errcodes.txt","record_count":263,"release":"12.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"943259f3e36af1343dd0f090f7c7cec0e8c762b038d68c178aaa9b1b11999bfb","size":33114,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_12_0","url":"https://github.com/postgres/postgres/blob/ad1f2885b8c82e0c2d56d7974f012cbecce17a17/src/backend/utils/errcodes.txt","version":"12.0"},{"blob_id":"sha256:9a464a3c3c99d2488782d4cdd0d46ce261085a944cb0c21e2d884586fbc8204d","channel":"formal","code_count":258,"commit":"29be9983a64c011eac0b9ee29895cce71e15ea77","id":"postgresql:REL_13_0:src/backend/utils/errcodes.txt","major":"13","parsed_path":"raw/definitions/REL_13_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_13_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/29be9983a64c011eac0b9ee29895cce71e15ea77/src/backend/utils/errcodes.txt","record_count":264,"release":"13.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"9a464a3c3c99d2488782d4cdd0d46ce261085a944cb0c21e2d884586fbc8204d","size":33239,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_13_0","url":"https://github.com/postgres/postgres/blob/29be9983a64c011eac0b9ee29895cce71e15ea77/src/backend/utils/errcodes.txt","version":"13.0"},{"blob_id":"sha256:c3c967fa20577f7ded946cb99e1a4706b85bb2476fd32d7e4a133c971a603552","channel":"formal","code_count":259,"commit":"86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c","id":"postgresql:REL_14_0:src/backend/utils/errcodes.txt","major":"14","parsed_path":"raw/definitions/REL_14_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_14_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/src/backend/utils/errcodes.txt","record_count":265,"release":"14.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"c3c967fa20577f7ded946cb99e1a4706b85bb2476fd32d7e4a133c971a603552","size":33337,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_14_0","url":"https://github.com/postgres/postgres/blob/86a4dc1e6f29d1992a2afa3fac1a0b0a6e84568c/src/backend/utils/errcodes.txt","version":"14.0"},{"blob_id":"sha256:a34b5fccd8a27c92817314dd942b79e76896cd1d9a8d4be21c81b02227850b4a","channel":"formal","code_count":260,"commit":"2a7ce2e2ce474504a707ec03e128fde66cfb8b48","id":"postgresql:REL_15_0:src/backend/utils/errcodes.txt","major":"15","parsed_path":"raw/definitions/REL_15_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_15_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/2a7ce2e2ce474504a707ec03e128fde66cfb8b48/src/backend/utils/errcodes.txt","record_count":266,"release":"15.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"a34b5fccd8a27c92817314dd942b79e76896cd1d9a8d4be21c81b02227850b4a","size":33458,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_15_0","url":"https://github.com/postgres/postgres/blob/2a7ce2e2ce474504a707ec03e128fde66cfb8b48/src/backend/utils/errcodes.txt","version":"15.0"},{"blob_id":"sha256:1d1d741b7b7c6dfd8275287e31c79befed75f3b9349e1a42ef0ca147c429ff88","channel":"formal","code_count":260,"commit":"c372fbbd8e911f2412b80a8c39d7079366565d67","id":"postgresql:REL_16_0:src/backend/utils/errcodes.txt","major":"16","parsed_path":"raw/definitions/REL_16_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_16_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/c372fbbd8e911f2412b80a8c39d7079366565d67/src/backend/utils/errcodes.txt","record_count":266,"release":"16.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"1d1d741b7b7c6dfd8275287e31c79befed75f3b9349e1a42ef0ca147c429ff88","size":33458,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_16_0","url":"https://github.com/postgres/postgres/blob/c372fbbd8e911f2412b80a8c39d7079366565d67/src/backend/utils/errcodes.txt","version":"16.0"},{"blob_id":"sha256:bb53279934510355eb4135a807c90d989f07650bd90f87026a4441f11d3296b1","channel":"formal","code_count":260,"commit":"d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e","id":"postgresql:REL_17_0:src/backend/utils/errcodes.txt","major":"17","parsed_path":"raw/definitions/REL_17_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_17_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/src/backend/utils/errcodes.txt","record_count":266,"release":"17.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"bb53279934510355eb4135a807c90d989f07650bd90f87026a4441f11d3296b1","size":33392,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_17_0","url":"https://github.com/postgres/postgres/blob/d7ec59a63d745ba74fba0e280bbf85dc6d1caa3e/src/backend/utils/errcodes.txt","version":"17.0"},{"blob_id":"sha256:6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba","channel":"formal","code_count":262,"commit":"3d6a828938a5fa0444275d3d2f67b64ec3199eb7","id":"postgresql:REL_18_0:src/backend/utils/errcodes.txt","major":"18","parsed_path":"raw/definitions/REL_18_0.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_18_0.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/errcodes.txt","record_count":268,"release":"18.0","release_date":null,"repository":"https://github.com/postgres/postgres.git","sha256":"6e8de346643ba84aa3c9c6a73360acfc7b2dfb89162c06c08ce9bf5bcd5bbcba","size":33739,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_18_0","url":"https://github.com/postgres/postgres/blob/3d6a828938a5fa0444275d3d2f67b64ec3199eb7/src/backend/utils/errcodes.txt","version":"18.0"},{"blob_id":"sha256:cadb9e83cde9a8699a7e74448891ca623af8579ccc8e11c7e533fb47cbc42f89","channel":"preview","code_count":262,"commit":"3638289fb57bdabec00deda98ee9624a35f5d66a","id":"postgresql:REL_19_BETA3:src/backend/utils/errcodes.txt","major":"19","parsed_path":"raw/definitions/REL_19_BETA3.parsed.json","path":"src/backend/utils/errcodes.txt","raw_path":"raw/definitions/REL_19_BETA3.txt","raw_url":"https://raw.githubusercontent.com/postgres/postgres/3638289fb57bdabec00deda98ee9624a35f5d66a/src/backend/utils/errcodes.txt","record_count":268,"release":"19beta3","release_date":"2026-08-13","repository":"https://github.com/postgres/postgres.git","sha256":"cadb9e83cde9a8699a7e74448891ca623af8579ccc8e11c7e533fb47cbc42f89","size":33739,"source_format":"errcodes.txt","source_role":"primary_definition","tag":"REL_19_BETA3","url":"https://github.com/postgres/postgres/blob/3638289fb57bdabec00deda98ee9624a35f5d66a/src/backend/utils/errcodes.txt","version":"19beta3"}],"sqlstate":"23505","status":"active","usage_evidence":[{"evidence_ids":["postgresql:REL7_4:src/include/utils/errcodes.h","postgresql:REL7_4_10:src/include/utils/errcodes.h","postgresql:REL7_4_11:src/include/utils/errcodes.h","postgresql:REL7_4_12:src/include/utils/errcodes.h","postgresql:REL7_4_13:src/include/utils/errcodes.h","postgresql:REL7_4_14:src/include/utils/errcodes.h","postgresql:REL7_4_15:src/include/utils/errcodes.h","postgresql:REL7_4_16:src/include/utils/errcodes.h","postgresql:REL7_4_17:src/include/utils/errcodes.h","postgresql:REL7_4_18:src/include/utils/errcodes.h","postgresql:REL7_4_19:src/include/utils/errcodes.h","postgresql:REL7_4_1:src/include/utils/errcodes.h","postgresql:REL7_4_20:src/include/utils/errcodes.h","postgresql:REL7_4_21:src/include/utils/errcodes.h","postgresql:REL7_4_22:src/include/utils/errcodes.h","postgresql:REL7_4_23:src/include/utils/errcodes.h","postgresql:REL7_4_24:src/include/utils/errcodes.h","postgresql:REL7_4_25:src/include/utils/errcodes.h","postgresql:REL7_4_26:src/include/utils/errcodes.h","postgresql:REL7_4_27:src/include/utils/errcodes.h","postgresql:REL7_4_28:src/include/utils/errcodes.h","postgresql:REL7_4_29:src/include/utils/errcodes.h","postgresql:REL7_4_2:src/include/utils/errcodes.h","postgresql:REL7_4_30:src/include/utils/errcodes.h","postgresql:REL7_4_3:src/include/utils/errcodes.h","postgresql:REL7_4_4:src/include/utils/errcodes.h","postgresql:REL7_4_5:src/include/utils/errcodes.h","postgresql:REL7_4_6:src/include/utils/errcodes.h","postgresql:REL7_4_7:src/include/utils/errcodes.h","postgresql:REL7_4_8:src/include/utils/errcodes.h","postgresql:REL7_4_9:src/include/utils/errcodes.h","postgresql:REL8_0_0:src/include/utils/errcodes.h","postgresql:REL8_0_10:src/include/utils/errcodes.h","postgresql:REL8_0_11:src/include/utils/errcodes.h","postgresql:REL8_0_12:src/include/utils/errcodes.h","postgresql:REL8_0_13:src/include/utils/errcodes.h","postgresql:REL8_0_14:src/include/utils/errcodes.h","postgresql:REL8_0_15:src/include/utils/errcodes.h","postgresql:REL8_0_16:src/include/utils/errcodes.h","postgresql:REL8_0_17:src/include/utils/errcodes.h","postgresql:REL8_0_18:src/include/utils/errcodes.h","postgresql:REL8_0_19:src/include/utils/errcodes.h","postgresql:REL8_0_1:src/include/utils/errcodes.h","postgresql:REL8_0_20:src/include/utils/errcodes.h","postgresql:REL8_0_21:src/include/utils/errcodes.h","postgresql:REL8_0_22:src/include/utils/errcodes.h","postgresql:REL8_0_23:src/include/utils/errcodes.h","postgresql:REL8_0_24:src/include/utils/errcodes.h","postgresql:REL8_0_25:src/include/utils/errcodes.h","postgresql:REL8_0_26:src/include/utils/errcodes.h","postgresql:REL8_0_2:src/include/utils/errcodes.h","postgresql:REL8_0_3:src/include/utils/errcodes.h","postgresql:REL8_0_4:src/include/utils/errcodes.h","postgresql:REL8_0_5:src/include/utils/errcodes.h","postgresql:REL8_0_6:src/include/utils/errcodes.h","postgresql:REL8_0_7:src/include/utils/errcodes.h","postgresql:REL8_0_8:src/include/utils/errcodes.h","postgresql:REL8_0_9:src/include/utils/errcodes.h","postgresql:REL8_1_0:src/include/utils/errcodes.h","postgresql:REL8_1_10:src/include/utils/errcodes.h","postgresql:REL8_1_11:src/include/utils/errcodes.h","postgresql:REL8_1_12:src/include/utils/errcodes.h","postgresql:REL8_1_13:src/include/utils/errcodes.h","postgresql:REL8_1_14:src/include/utils/errcodes.h","postgresql:REL8_1_15:src/include/utils/errcodes.h","postgresql:REL8_1_16:src/include/utils/errcodes.h","postgresql:REL8_1_17:src/include/utils/errcodes.h","postgresql:REL8_1_18:src/include/utils/errcodes.h","postgresql:REL8_1_19:src/include/utils/errcodes.h","postgresql:REL8_1_1:src/include/utils/errcodes.h","postgresql:REL8_1_20:src/include/utils/errcodes.h","postgresql:REL8_1_21:src/include/utils/errcodes.h","postgresql:REL8_1_22:src/include/utils/errcodes.h","postgresql:REL8_1_23:src/include/utils/errcodes.h","postgresql:REL8_1_2:src/include/utils/errcodes.h","postgresql:REL8_1_3:src/include/utils/errcodes.h","postgresql:REL8_1_4:src/include/utils/errcodes.h","postgresql:REL8_1_5:src/include/utils/errcodes.h","postgresql:REL8_1_6:src/include/utils/errcodes.h","postgresql:REL8_1_7:src/include/utils/errcodes.h","postgresql:REL8_1_8:src/include/utils/errcodes.h","postgresql:REL8_1_9:src/include/utils/errcodes.h","postgresql:REL8_2_0:src/include/utils/errcodes.h","postgresql:REL8_2_10:src/include/utils/errcodes.h","postgresql:REL8_2_11:src/include/utils/errcodes.h","postgresql:REL8_2_12:src/include/utils/errcodes.h","postgresql:REL8_2_13:src/include/utils/errcodes.h","postgresql:REL8_2_14:src/include/utils/errcodes.h","postgresql:REL8_2_15:src/include/utils/errcodes.h","postgresql:REL8_2_16:src/include/utils/errcodes.h","postgresql:REL8_2_17:src/include/utils/errcodes.h","postgresql:REL8_2_18:src/include/utils/errcodes.h","postgresql:REL8_2_19:src/include/utils/errcodes.h","postgresql:REL8_2_1:src/include/utils/errcodes.h","postgresql:REL8_2_20:src/include/utils/errcodes.h","postgresql:REL8_2_21:src/include/utils/errcodes.h","postgresql:REL8_2_22:src/include/utils/errcodes.h","postgresql:REL8_2_23:src/include/utils/errcodes.h","postgresql:REL8_2_2:src/include/utils/errcodes.h","postgresql:REL8_2_3:src/include/utils/errcodes.h","postgresql:REL8_2_4:src/include/utils/errcodes.h","postgresql:REL8_2_5:src/include/utils/errcodes.h","postgresql:REL8_2_6:src/include/utils/errcodes.h","postgresql:REL8_2_7:src/include/utils/errcodes.h","postgresql:REL8_2_8:src/include/utils/errcodes.h","postgresql:REL8_2_9:src/include/utils/errcodes.h","postgresql:REL8_3_0:src/include/utils/errcodes.h","postgresql:REL8_3_10:src/include/utils/errcodes.h","postgresql:REL8_3_11:src/include/utils/errcodes.h","postgresql:REL8_3_12:src/include/utils/errcodes.h","postgresql:REL8_3_13:src/include/utils/errcodes.h","postgresql:REL8_3_14:src/include/utils/errcodes.h","postgresql:REL8_3_15:src/include/utils/errcodes.h","postgresql:REL8_3_16:src/include/utils/errcodes.h","postgresql:REL8_3_17:src/include/utils/errcodes.h","postgresql:REL8_3_18:src/include/utils/errcodes.h","postgresql:REL8_3_19:src/include/utils/errcodes.h","postgresql:REL8_3_1:src/include/utils/errcodes.h","postgresql:REL8_3_20:src/include/utils/errcodes.h","postgresql:REL8_3_21:src/include/utils/errcodes.h","postgresql:REL8_3_22:src/include/utils/errcodes.h","postgresql:REL8_3_23:src/include/utils/errcodes.h","postgresql:REL8_3_2:src/include/utils/errcodes.h","postgresql:REL8_3_3:src/include/utils/errcodes.h","postgresql:REL8_3_4:src/include/utils/errcodes.h","postgresql:REL8_3_5:src/include/utils/errcodes.h","postgresql:REL8_3_6:src/include/utils/errcodes.h","postgresql:REL8_3_7:src/include/utils/errcodes.h","postgresql:REL8_3_8:src/include/utils/errcodes.h","postgresql:REL8_3_9:src/include/utils/errcodes.h","postgresql:REL8_4_0:src/include/utils/errcodes.h","postgresql:REL8_4_10:src/include/utils/errcodes.h","postgresql:REL8_4_11:src/include/utils/errcodes.h","postgresql:REL8_4_12:src/include/utils/errcodes.h","postgresql:REL8_4_13:src/include/utils/errcodes.h","postgresql:REL8_4_14:src/include/utils/errcodes.h","postgresql:REL8_4_15:src/include/utils/errcodes.h","postgresql:REL8_4_16:src/include/utils/errcodes.h","postgresql:REL8_4_17:src/include/utils/errcodes.h","postgresql:REL8_4_18:src/include/utils/errcodes.h","postgresql:REL8_4_19:src/include/utils/errcodes.h","postgresql:REL8_4_1:src/include/utils/errcodes.h","postgresql:REL8_4_20:src/include/utils/errcodes.h","postgresql:REL8_4_21:src/include/utils/errcodes.h","postgresql:REL8_4_22:src/include/utils/errcodes.h","postgresql:REL8_4_2:src/include/utils/errcodes.h","postgresql:REL8_4_3:src/include/utils/errcodes.h","postgresql:REL8_4_4:src/include/utils/errcodes.h","postgresql:REL8_4_5:src/include/utils/errcodes.h","postgresql:REL8_4_6:src/include/utils/errcodes.h","postgresql:REL8_4_7:src/include/utils/errcodes.h","postgresql:REL8_4_8:src/include/utils/errcodes.h","postgresql:REL8_4_9:src/include/utils/errcodes.h","postgresql:REL9_0_0:src/include/utils/errcodes.h","postgresql:REL9_0_10:src/include/utils/errcodes.h","postgresql:REL9_0_11:src/include/utils/errcodes.h","postgresql:REL9_0_12:src/include/utils/errcodes.h","postgresql:REL9_0_13:src/include/utils/errcodes.h","postgresql:REL9_0_14:src/include/utils/errcodes.h","postgresql:REL9_0_15:src/include/utils/errcodes.h","postgresql:REL9_0_16:src/include/utils/errcodes.h","postgresql:REL9_0_17:src/include/utils/errcodes.h","postgresql:REL9_0_18:src/include/utils/errcodes.h","postgresql:REL9_0_19:src/include/utils/errcodes.h","postgresql:REL9_0_1:src/include/utils/errcodes.h","postgresql:REL9_0_20:src/include/utils/errcodes.h","postgresql:REL9_0_21:src/include/utils/errcodes.h","postgresql:REL9_0_22:src/include/utils/errcodes.h","postgresql:REL9_0_23:src/include/utils/errcodes.h","postgresql:REL9_0_2:src/include/utils/errcodes.h","postgresql:REL9_0_3:src/include/utils/errcodes.h","postgresql:REL9_0_4:src/include/utils/errcodes.h","postgresql:REL9_0_5:src/include/utils/errcodes.h","postgresql:REL9_0_6:src/include/utils/errcodes.h","postgresql:REL9_0_7:src/include/utils/errcodes.h","postgresql:REL9_0_8:src/include/utils/errcodes.h","postgresql:REL9_0_9:src/include/utils/errcodes.h","postgresql:REL9_1_0:src/backend/utils/errcodes.txt","postgresql:REL9_1_10:src/backend/utils/errcodes.txt","postgresql:REL9_1_11:src/backend/utils/errcodes.txt","postgresql:REL9_1_12:src/backend/utils/errcodes.txt","postgresql:REL9_1_13:src/backend/utils/errcodes.txt","postgresql:REL9_1_14:src/backend/utils/errcodes.txt","postgresql:REL9_1_15:src/backend/utils/errcodes.txt","postgresql:REL9_1_16:src/backend/utils/errcodes.txt","postgresql:REL9_1_17:src/backend/utils/errcodes.txt","postgresql:REL9_1_18:src/backend/utils/errcodes.txt","postgresql:REL9_1_19:src/backend/utils/errcodes.txt","postgresql:REL9_1_1:src/backend/utils/errcodes.txt","postgresql:REL9_1_20:src/backend/utils/errcodes.txt","postgresql:REL9_1_21:src/backend/utils/errcodes.txt","postgresql:REL9_1_22:src/backend/utils/errcodes.txt","postgresql:REL9_1_23:src/backend/utils/errcodes.txt","postgresql:REL9_1_24:src/backend/utils/errcodes.txt","postgresql:REL9_1_2:src/backend/utils/errcodes.txt","postgresql:REL9_1_3:src/backend/utils/errcodes.txt","postgresql:REL9_1_4:src/backend/utils/errcodes.txt","postgresql:REL9_1_5:src/backend/utils/errcodes.txt","postgresql:REL9_1_6:src/backend/utils/errcodes.txt","postgresql:REL9_1_7:src/backend/utils/errcodes.txt","postgresql:REL9_1_8:src/backend/utils/errcodes.txt","postgresql:REL9_1_9:src/backend/utils/errcodes.txt","postgresql:REL9_2_0:src/backend/utils/errcodes.txt","postgresql:REL9_2_10:src/backend/utils/errcodes.txt","postgresql:REL9_2_11:src/backend/utils/errcodes.txt","postgresql:REL9_2_12:src/backend/utils/errcodes.txt","postgresql:REL9_2_13:src/backend/utils/errcodes.txt","postgresql:REL9_2_14:src/backend/utils/errcodes.txt","postgresql:REL9_2_15:src/backend/utils/errcodes.txt","postgresql:REL9_2_16:src/backend/utils/errcodes.txt","postgresql:REL9_2_17:src/backend/utils/errcodes.txt","postgresql:REL9_2_18:src/backend/utils/errcodes.txt","postgresql:REL9_2_19:src/backend/utils/errcodes.txt","postgresql:REL9_2_1:src/backend/utils/errcodes.txt","postgresql:REL9_2_20:src/backend/utils/errcodes.txt","postgresql:REL9_2_21:src/backend/utils/errcodes.txt","postgresql:REL9_2_22:src/backend/utils/errcodes.txt","postgresql:REL9_2_23:src/backend/utils/errcodes.txt","postgresql:REL9_2_24:src/backend/utils/errcodes.txt","postgresql:REL9_2_2:src/backend/utils/errcodes.txt","postgresql:REL9_2_3:src/backend/utils/errcodes.txt","postgresql:REL9_2_4:src/backend/utils/errcodes.txt","postgresql:REL9_2_5:src/backend/utils/errcodes.txt","postgresql:REL9_2_6:src/backend/utils/errcodes.txt","postgresql:REL9_2_7:src/backend/utils/errcodes.txt","postgresql:REL9_2_8:src/backend/utils/errcodes.txt","postgresql:REL9_2_9:src/backend/utils/errcodes.txt","postgresql:REL9_3_0:src/backend/utils/errcodes.txt","postgresql:REL9_3_10:src/backend/utils/errcodes.txt","postgresql:REL9_3_11:src/backend/utils/errcodes.txt","postgresql:REL9_3_12:src/backend/utils/errcodes.txt","postgresql:REL9_3_13:src/backend/utils/errcodes.txt","postgresql:REL9_3_14:src/backend/utils/errcodes.txt","postgresql:REL9_3_15:src/backend/utils/errcodes.txt","postgresql:REL9_3_16:src/backend/utils/errcodes.txt","postgresql:REL9_3_17:src/backend/utils/errcodes.txt","postgresql:REL9_3_18:src/backend/utils/errcodes.txt","postgresql:REL9_3_19:src/backend/utils/errcodes.txt","postgresql:REL9_3_1:src/backend/utils/errcodes.txt","postgresql:REL9_3_20:src/backend/utils/errcodes.txt","postgresql:REL9_3_21:src/backend/utils/errcodes.txt","postgresql:REL9_3_22:src/backend/utils/errcodes.txt","postgresql:REL9_3_23:src/backend/utils/errcodes.txt","postgresql:REL9_3_24:src/backend/utils/errcodes.txt","postgresql:REL9_3_25:src/backend/utils/errcodes.txt","postgresql:REL9_3_2:src/backend/utils/errcodes.txt","postgresql:REL9_3_3:src/backend/utils/errcodes.txt","postgresql:REL9_3_4:src/backend/utils/errcodes.txt","postgresql:REL9_3_5:src/backend/utils/errcodes.txt","postgresql:REL9_3_6:src/backend/utils/errcodes.txt","postgresql:REL9_3_7:src/backend/utils/errcodes.txt","postgresql:REL9_3_8:src/backend/utils/errcodes.txt","postgresql:REL9_3_9:src/backend/utils/errcodes.txt","postgresql:REL9_4_0:src/backend/utils/errcodes.txt","postgresql:REL9_4_10:src/backend/utils/errcodes.txt","postgresql:REL9_4_11:src/backend/utils/errcodes.txt","postgresql:REL9_4_12:src/backend/utils/errcodes.txt","postgresql:REL9_4_13:src/backend/utils/errcodes.txt","postgresql:REL9_4_14:src/backend/utils/errcodes.txt","postgresql:REL9_4_15:src/backend/utils/errcodes.txt","postgresql:REL9_4_16:src/backend/utils/errcodes.txt","postgresql:REL9_4_17:src/backend/utils/errcodes.txt","postgresql:REL9_4_18:src/backend/utils/errcodes.txt","postgresql:REL9_4_19:src/backend/utils/errcodes.txt","postgresql:REL9_4_1:src/backend/utils/errcodes.txt","postgresql:REL9_4_20:src/backend/utils/errcodes.txt","postgresql:REL9_4_21:src/backend/utils/errcodes.txt","postgresql:REL9_4_22:src/backend/utils/errcodes.txt","postgresql:REL9_4_23:src/backend/utils/errcodes.txt","postgresql:REL9_4_24:src/backend/utils/errcodes.txt","postgresql:REL9_4_25:src/backend/utils/errcodes.txt","postgresql:REL9_4_26:src/backend/utils/errcodes.txt","postgresql:REL9_4_2:src/backend/utils/errcodes.txt","postgresql:REL9_4_3:src/backend/utils/errcodes.txt","postgresql:REL9_4_4:src/backend/utils/errcodes.txt","postgresql:REL9_4_5:src/backend/utils/errcodes.txt","postgresql:REL9_4_6:src/backend/utils/errcodes.txt","postgresql:REL9_4_7:src/backend/utils/errcodes.txt","postgresql:REL9_4_8:src/backend/utils/errcodes.txt","postgresql:REL9_4_9:src/backend/utils/errcodes.txt","postgresql:REL9_5_0:src/backend/utils/errcodes.txt","postgresql:REL9_5_10:src/backend/utils/errcodes.txt","postgresql:REL9_5_11:src/backend/utils/errcodes.txt","postgresql:REL9_5_12:src/backend/utils/errcodes.txt","postgresql:REL9_5_13:src/backend/utils/errcodes.txt","postgresql:REL9_5_14:src/backend/utils/errcodes.txt","postgresql:REL9_5_15:src/backend/utils/errcodes.txt","postgresql:REL9_5_16:src/backend/utils/errcodes.txt","postgresql:REL9_5_17:src/backend/utils/errcodes.txt","postgresql:REL9_5_18:src/backend/utils/errcodes.txt","postgresql:REL9_5_19:src/backend/utils/errcodes.txt","postgresql:REL9_5_1:src/backend/utils/errcodes.txt","postgresql:REL9_5_20:src/backend/utils/errcodes.txt","postgresql:REL9_5_21:src/backend/utils/errcodes.txt","postgresql:REL9_5_22:src/backend/utils/errcodes.txt","postgresql:REL9_5_23:src/backend/utils/errcodes.txt","postgresql:REL9_5_24:src/backend/utils/errcodes.txt","postgresql:REL9_5_25:src/backend/utils/errcodes.txt","postgresql:REL9_5_2:src/backend/utils/errcodes.txt","postgresql:REL9_5_3:src/backend/utils/errcodes.txt","postgresql:REL9_5_4:src/backend/utils/errcodes.txt","postgresql:REL9_5_5:src/backend/utils/errcodes.txt","postgresql:REL9_5_6:src/backend/utils/errcodes.txt","postgresql:REL9_5_7:src/backend/utils/errcodes.txt","postgresql:REL9_5_8:src/backend/utils/errcodes.txt","postgresql:REL9_5_9:src/backend/utils/errcodes.txt","postgresql:REL9_6_0:src/backend/utils/errcodes.txt","postgresql:REL9_6_10:src/backend/utils/errcodes.txt","postgresql:REL9_6_11:src/backend/utils/errcodes.txt","postgresql:REL9_6_12:src/backend/utils/errcodes.txt","postgresql:REL9_6_13:src/backend/utils/errcodes.txt","postgresql:REL9_6_14:src/backend/utils/errcodes.txt","postgresql:REL9_6_15:src/backend/utils/errcodes.txt","postgresql:REL9_6_16:src/backend/utils/errcodes.txt","postgresql:REL9_6_17:src/backend/utils/errcodes.txt","postgresql:REL9_6_18:src/backend/utils/errcodes.txt","postgresql:REL9_6_19:src/backend/utils/errcodes.txt","postgresql:REL9_6_1:src/backend/utils/errcodes.txt","postgresql:REL9_6_20:src/backend/utils/errcodes.txt","postgresql:REL9_6_21:src/backend/utils/errcodes.txt","postgresql:REL9_6_22:src/backend/utils/errcodes.txt","postgresql:REL9_6_23:src/backend/utils/errcodes.txt","postgresql:REL9_6_24:src/backend/utils/errcodes.txt","postgresql:REL9_6_2:src/backend/utils/errcodes.txt","postgresql:REL9_6_3:src/backend/utils/errcodes.txt","postgresql:REL9_6_4:src/backend/utils/errcodes.txt","postgresql:REL9_6_5:src/backend/utils/errcodes.txt","postgresql:REL9_6_6:src/backend/utils/errcodes.txt","postgresql:REL9_6_7:src/backend/utils/errcodes.txt","postgresql:REL9_6_8:src/backend/utils/errcodes.txt","postgresql:REL9_6_9:src/backend/utils/errcodes.txt","postgresql:REL_10_0:src/backend/utils/errcodes.txt","postgresql:REL_10_10:src/backend/utils/errcodes.txt","postgresql:REL_10_11:src/backend/utils/errcodes.txt","postgresql:REL_10_12:src/backend/utils/errcodes.txt","postgresql:REL_10_13:src/backend/utils/errcodes.txt","postgresql:REL_10_14:src/backend/utils/errcodes.txt","postgresql:REL_10_15:src/backend/utils/errcodes.txt","postgresql:REL_10_16:src/backend/utils/errcodes.txt","postgresql:REL_10_17:src/backend/utils/errcodes.txt","postgresql:REL_10_18:src/backend/utils/errcodes.txt","postgresql:REL_10_19:src/backend/utils/errcodes.txt","postgresql:REL_10_1:src/backend/utils/errcodes.txt","postgresql:REL_10_20:src/backend/utils/errcodes.txt","postgresql:REL_10_21:src/backend/utils/errcodes.txt","postgresql:REL_10_22:src/backend/utils/errcodes.txt","postgresql:REL_10_23:src/backend/utils/errcodes.txt","postgresql:REL_10_2:src/backend/utils/errcodes.txt","postgresql:REL_10_3:src/backend/utils/errcodes.txt","postgresql:REL_10_4:src/backend/utils/errcodes.txt","postgresql:REL_10_5:src/backend/utils/errcodes.txt","postgresql:REL_10_6:src/backend/utils/errcodes.txt","postgresql:REL_10_7:src/backend/utils/errcodes.txt","postgresql:REL_10_8:src/backend/utils/errcodes.txt","postgresql:REL_10_9:src/backend/utils/errcodes.txt","postgresql:REL_11_0:src/backend/utils/errcodes.txt","postgresql:REL_11_10:src/backend/utils/errcodes.txt","postgresql:REL_11_11:src/backend/utils/errcodes.txt","postgresql:REL_11_12:src/backend/utils/errcodes.txt","postgresql:REL_11_13:src/backend/utils/errcodes.txt","postgresql:REL_11_14:src/backend/utils/errcodes.txt","postgresql:REL_11_15:src/backend/utils/errcodes.txt","postgresql:REL_11_16:src/backend/utils/errcodes.txt","postgresql:REL_11_17:src/backend/utils/errcodes.txt","postgresql:REL_11_18:src/backend/utils/errcodes.txt","postgresql:REL_11_19:src/backend/utils/errcodes.txt","postgresql:REL_11_1:src/backend/utils/errcodes.txt","postgresql:REL_11_20:src/backend/utils/errcodes.txt","postgresql:REL_11_21:src/backend/utils/errcodes.txt","postgresql:REL_11_22:src/backend/utils/errcodes.txt","postgresql:REL_11_2:src/backend/utils/errcodes.txt","postgresql:REL_11_3:src/backend/utils/errcodes.txt","postgresql:REL_11_4:src/backend/utils/errcodes.txt","postgresql:REL_11_5:src/backend/utils/errcodes.txt","postgresql:REL_11_6:src/backend/utils/errcodes.txt","postgresql:REL_11_7:src/backend/utils/errcodes.txt","postgresql:REL_11_8:src/backend/utils/errcodes.txt","postgresql:REL_11_9:src/backend/utils/errcodes.txt","postgresql:REL_12_0:src/backend/utils/errcodes.txt","postgresql:REL_12_10:src/backend/utils/errcodes.txt","postgresql:REL_12_11:src/backend/utils/errcodes.txt","postgresql:REL_12_12:src/backend/utils/errcodes.txt","postgresql:REL_12_13:src/backend/utils/errcodes.txt","postgresql:REL_12_14:src/backend/utils/errcodes.txt","postgresql:REL_12_15:src/backend/utils/errcodes.txt","postgresql:REL_12_16:src/backend/utils/errcodes.txt","postgresql:REL_12_17:src/backend/utils/errcodes.txt","postgresql:REL_12_18:src/backend/utils/errcodes.txt","postgresql:REL_12_19:src/backend/utils/errcodes.txt","postgresql:REL_12_1:src/backend/utils/errcodes.txt","postgresql:REL_12_20:src/backend/utils/errcodes.txt","postgresql:REL_12_21:src/backend/utils/errcodes.txt","postgresql:REL_12_22:src/backend/utils/errcodes.txt","postgresql:REL_12_2:src/backend/utils/errcodes.txt","postgresql:REL_12_3:src/backend/utils/errcodes.txt","postgresql:REL_12_4:src/backend/utils/errcodes.txt","postgresql:REL_12_5:src/backend/utils/errcodes.txt","postgresql:REL_12_6:src/backend/utils/errcodes.txt","postgresql:REL_12_7:src/backend/utils/errcodes.txt","postgresql:REL_12_8:src/backend/utils/errcodes.txt","postgresql:REL_12_9:src/backend/utils/errcodes.txt","postgresql:REL_13_0:src/backend/utils/errcodes.txt","postgresql:REL_13_10:src/backend/utils/errcodes.txt","postgresql:REL_13_11:src/backend/utils/errcodes.txt","postgresql:REL_13_12:src/backend/utils/errcodes.txt","postgresql:REL_13_13:src/backend/utils/errcodes.txt","postgresql:REL_13_14:src/backend/utils/errcodes.txt","postgresql:REL_13_15:src/backend/utils/errcodes.txt","postgresql:REL_13_16:src/backend/utils/errcodes.txt","postgresql:REL_13_17:src/backend/utils/errcodes.txt","postgresql:REL_13_18:src/backend/utils/errcodes.txt","postgresql:REL_13_19:src/backend/utils/errcodes.txt","postgresql:REL_13_1:src/backend/utils/errcodes.txt","postgresql:REL_13_20:src/backend/utils/errcodes.txt","postgresql:REL_13_21:src/backend/utils/errcodes.txt","postgresql:REL_13_22:src/backend/utils/errcodes.txt","postgresql:REL_13_23:src/backend/utils/errcodes.txt","postgresql:REL_13_2:src/backend/utils/errcodes.txt","postgresql:REL_13_3:src/backend/utils/errcodes.txt","postgresql:REL_13_4:src/backend/utils/errcodes.txt","postgresql:REL_13_5:src/backend/utils/errcodes.txt","postgresql:REL_13_6:src/backend/utils/errcodes.txt","postgresql:REL_13_7:src/backend/utils/errcodes.txt","postgresql:REL_13_8:src/backend/utils/errcodes.txt","postgresql:REL_13_9:src/backend/utils/errcodes.txt","postgresql:REL_14_0:src/backend/utils/errcodes.txt","postgresql:REL_14_10:src/backend/utils/errcodes.txt","postgresql:REL_14_11:src/backend/utils/errcodes.txt","postgresql:REL_14_12:src/backend/utils/errcodes.txt","postgresql:REL_14_13:src/backend/utils/errcodes.txt","postgresql:REL_14_14:src/backend/utils/errcodes.txt","postgresql:REL_14_15:src/backend/utils/errcodes.txt","postgresql:REL_14_16:src/backend/utils/errcodes.txt","postgresql:REL_14_17:src/backend/utils/errcodes.txt","postgresql:REL_14_18:src/backend/utils/errcodes.txt","postgresql:REL_14_19:src/backend/utils/errcodes.txt","postgresql:REL_14_1:src/backend/utils/errcodes.txt","postgresql:REL_14_20:src/backend/utils/errcodes.txt","postgresql:REL_14_21:src/backend/utils/errcodes.txt","postgresql:REL_14_22:src/backend/utils/errcodes.txt","postgresql:REL_14_23:src/backend/utils/errcodes.txt","postgresql:REL_14_24:src/backend/utils/errcodes.txt","postgresql:REL_14_2:src/backend/utils/errcodes.txt","postgresql:REL_14_3:src/backend/utils/errcodes.txt","postgresql:REL_14_4:src/backend/utils/errcodes.txt","postgresql:REL_14_5:src/backend/utils/errcodes.txt","postgresql:REL_14_6:src/backend/utils/errcodes.txt","postgresql:REL_14_7:src/backend/utils/errcodes.txt","postgresql:REL_14_8:src/backend/utils/errcodes.txt","postgresql:REL_14_9:src/backend/utils/errcodes.txt","postgresql:REL_15_0:src/backend/utils/errcodes.txt","postgresql:REL_15_10:src/backend/utils/errcodes.txt","postgresql:REL_15_11:src/backend/utils/errcodes.txt","postgresql:REL_15_12:src/backend/utils/errcodes.txt","postgresql:REL_15_13:src/backend/utils/errcodes.txt","postgresql:REL_15_14:src/backend/utils/errcodes.txt","postgresql:REL_15_15:src/backend/utils/errcodes.txt","postgresql:REL_15_16:src/backend/utils/errcodes.txt","postgresql:REL_15_17:src/backend/utils/errcodes.txt","postgresql:REL_15_18:src/backend/utils/errcodes.txt","postgresql:REL_15_19:src/backend/utils/errcodes.txt","postgresql:REL_15_1:src/backend/utils/errcodes.txt","postgresql:REL_15_2:src/backend/utils/errcodes.txt","postgresql:REL_15_3:src/backend/utils/errcodes.txt","postgresql:REL_15_4:src/backend/utils/errcodes.txt","postgresql:REL_15_5:src/backend/utils/errcodes.txt","postgresql:REL_15_6:src/backend/utils/errcodes.txt","postgresql:REL_15_7:src/backend/utils/errcodes.txt","postgresql:REL_15_8:src/backend/utils/errcodes.txt","postgresql:REL_15_9:src/backend/utils/errcodes.txt","postgresql:REL_16_0:src/backend/utils/errcodes.txt","postgresql:REL_16_10:src/backend/utils/errcodes.txt","postgresql:REL_16_11:src/backend/utils/errcodes.txt","postgresql:REL_16_12:src/backend/utils/errcodes.txt","postgresql:REL_16_13:src/backend/utils/errcodes.txt","postgresql:REL_16_14:src/backend/utils/errcodes.txt","postgresql:REL_16_15:src/backend/utils/errcodes.txt","postgresql:REL_16_1:src/backend/utils/errcodes.txt","postgresql:REL_16_2:src/backend/utils/errcodes.txt","postgresql:REL_16_3:src/backend/utils/errcodes.txt","postgresql:REL_16_4:src/backend/utils/errcodes.txt","postgresql:REL_16_5:src/backend/utils/errcodes.txt","postgresql:REL_16_6:src/backend/utils/errcodes.txt","postgresql:REL_16_7:src/backend/utils/errcodes.txt","postgresql:REL_16_8:src/backend/utils/errcodes.txt","postgresql:REL_16_9:src/backend/utils/errcodes.txt","postgresql:REL_17_0:src/backend/utils/errcodes.txt","postgresql:REL_17_10:src/backend/utils/errcodes.txt","postgresql:REL_17_11:src/backend/utils/errcodes.txt","postgresql:REL_17_1:src/backend/utils/errcodes.txt","postgresql:REL_17_2:src/backend/utils/errcodes.txt","postgresql:REL_17_3:src/backend/utils/errcodes.txt","postgresql:REL_17_4:src/backend/utils/errcodes.txt","postgresql:REL_17_5:src/backend/utils/errcodes.txt","postgresql:REL_17_6:src/backend/utils/errcodes.txt","postgresql:REL_17_7:src/backend/utils/errcodes.txt","postgresql:REL_17_8:src/backend/utils/errcodes.txt","postgresql:REL_17_9:src/backend/utils/errcodes.txt","postgresql:REL_18_0:src/backend/utils/errcodes.txt","postgresql:REL_18_1:src/backend/utils/errcodes.txt","postgresql:REL_18_2:src/backend/utils/errcodes.txt","postgresql:REL_18_3:src/backend/utils/errcodes.txt","postgresql:REL_18_4:src/backend/utils/errcodes.txt","postgresql:REL_18_6:src/backend/utils/errcodes.txt","postgresql:REL_19_BETA3:src/backend/utils/errcodes.txt"],"notes":"Presence in a PostgreSQL release definition file is established; runtime throw/use scanning is maintained separately.","scope":"release-definition-catalogue","status":"definition_only"},{"evidence_ids":["postgresql:REL7_4:src/include/utils/errcodes.h","postgresql:REL7_4_10:src/include/utils/errcodes.h","postgresql:REL7_4_11:src/include/utils/errcodes.h","postgresql:REL7_4_12:src/include/utils/errcodes.h","postgresql:REL7_4_13:src/include/utils/errcodes.h","postgresql:REL7_4_14:src/include/utils/errcodes.h","postgresql:REL7_4_15:src/include/utils/errcodes.h","postgresql:REL7_4_16:src/include/utils/errcodes.h","postgresql:REL7_4_17:src/include/utils/errcodes.h","postgresql:REL7_4_18:src/include/utils/errcodes.h","postgresql:REL7_4_19:src/include/utils/errcodes.h","postgresql:REL7_4_1:src/include/utils/errcodes.h","postgresql:REL7_4_20:src/include/utils/errcodes.h","postgresql:REL7_4_21:src/include/utils/errcodes.h","postgresql:REL7_4_22:src/include/utils/errcodes.h","postgresql:REL7_4_23:src/include/utils/errcodes.h","postgresql:REL7_4_24:src/include/utils/errcodes.h","postgresql:REL7_4_25:src/include/utils/errcodes.h","postgresql:REL7_4_26:src/include/utils/errcodes.h","postgresql:REL7_4_27:src/include/utils/errcodes.h","postgresql:REL7_4_28:src/include/utils/errcodes.h","postgresql:REL7_4_29:src/include/utils/errcodes.h","postgresql:REL7_4_2:src/include/utils/errcodes.h","postgresql:REL7_4_30:src/include/utils/errcodes.h","postgresql:REL7_4_3:src/include/utils/errcodes.h","postgresql:REL7_4_4:src/include/utils/errcodes.h","postgresql:REL7_4_5:src/include/utils/errcodes.h","postgresql:REL7_4_6:src/include/utils/errcodes.h","postgresql:REL7_4_7:src/include/utils/errcodes.h","postgresql:REL7_4_8:src/include/utils/errcodes.h","postgresql:REL7_4_9:src/include/utils/errcodes.h","postgresql:REL8_0_0:src/include/utils/errcodes.h","postgresql:REL8_0_10:src/include/utils/errcodes.h","postgresql:REL8_0_11:src/include/utils/errcodes.h","postgresql:REL8_0_12:src/include/utils/errcodes.h","postgresql:REL8_0_13:src/include/utils/errcodes.h","postgresql:REL8_0_14:src/include/utils/errcodes.h","postgresql:REL8_0_15:src/include/utils/errcodes.h","postgresql:REL8_0_16:src/include/utils/errcodes.h","postgresql:REL8_0_17:src/include/utils/errcodes.h","postgresql:REL8_0_18:src/include/utils/errcodes.h","postgresql:REL8_0_19:src/include/utils/errcodes.h","postgresql:REL8_0_1:src/include/utils/errcodes.h","postgresql:REL8_0_20:src/include/utils/errcodes.h","postgresql:REL8_0_21:src/include/utils/errcodes.h","postgresql:REL8_0_22:src/include/utils/errcodes.h","postgresql:REL8_0_23:src/include/utils/errcodes.h","postgresql:REL8_0_24:src/include/utils/errcodes.h","postgresql:REL8_0_25:src/include/utils/errcodes.h","postgresql:REL8_0_26:src/include/utils/errcodes.h","postgresql:REL8_0_2:src/include/utils/errcodes.h","postgresql:REL8_0_3:src/include/utils/errcodes.h","postgresql:REL8_0_4:src/include/utils/errcodes.h","postgresql:REL8_0_5:src/include/utils/errcodes.h","postgresql:REL8_0_6:src/include/utils/errcodes.h","postgresql:REL8_0_7:src/include/utils/errcodes.h","postgresql:REL8_0_8:src/include/utils/errcodes.h","postgresql:REL8_0_9:src/include/utils/errcodes.h","postgresql:REL8_1_0:src/include/utils/errcodes.h","postgresql:REL8_1_10:src/include/utils/errcodes.h","postgresql:REL8_1_11:src/include/utils/errcodes.h","postgresql:REL8_1_12:src/include/utils/errcodes.h","postgresql:REL8_1_13:src/include/utils/errcodes.h","postgresql:REL8_1_14:src/include/utils/errcodes.h","postgresql:REL8_1_15:src/include/utils/errcodes.h","postgresql:REL8_1_16:src/include/utils/errcodes.h","postgresql:REL8_1_17:src/include/utils/errcodes.h","postgresql:REL8_1_18:src/include/utils/errcodes.h","postgresql:REL8_1_19:src/include/utils/errcodes.h","postgresql:REL8_1_1:src/include/utils/errcodes.h","postgresql:REL8_1_20:src/include/utils/errcodes.h","postgresql:REL8_1_21:src/include/utils/errcodes.h","postgresql:REL8_1_22:src/include/utils/errcodes.h","postgresql:REL8_1_23:src/include/utils/errcodes.h","postgresql:REL8_1_2:src/include/utils/errcodes.h","postgresql:REL8_1_3:src/include/utils/errcodes.h","postgresql:REL8_1_4:src/include/utils/errcodes.h","postgresql:REL8_1_5:src/include/utils/errcodes.h","postgresql:REL8_1_6:src/include/utils/errcodes.h","postgresql:REL8_1_7:src/include/utils/errcodes.h","postgresql:REL8_1_8:src/include/utils/errcodes.h","postgresql:REL8_1_9:src/include/utils/errcodes.h","postgresql:REL8_2_0:src/include/utils/errcodes.h","postgresql:REL8_2_10:src/include/utils/errcodes.h","postgresql:REL8_2_11:src/include/utils/errcodes.h","postgresql:REL8_2_12:src/include/utils/errcodes.h","postgresql:REL8_2_13:src/include/utils/errcodes.h","postgresql:REL8_2_14:src/include/utils/errcodes.h","postgresql:REL8_2_15:src/include/utils/errcodes.h","postgresql:REL8_2_16:src/include/utils/errcodes.h","postgresql:REL8_2_17:src/include/utils/errcodes.h","postgresql:REL8_2_18:src/include/utils/errcodes.h","postgresql:REL8_2_19:src/include/utils/errcodes.h","postgresql:REL8_2_1:src/include/utils/errcodes.h","postgresql:REL8_2_20:src/include/utils/errcodes.h","postgresql:REL8_2_21:src/include/utils/errcodes.h","postgresql:REL8_2_22:src/include/utils/errcodes.h","postgresql:REL8_2_23:src/include/utils/errcodes.h","postgresql:REL8_2_2:src/include/utils/errcodes.h","postgresql:REL8_2_3:src/include/utils/errcodes.h","postgresql:REL8_2_4:src/include/utils/errcodes.h","postgresql:REL8_2_5:src/include/utils/errcodes.h","postgresql:REL8_2_6:src/include/utils/errcodes.h","postgresql:REL8_2_7:src/include/utils/errcodes.h","postgresql:REL8_2_8:src/include/utils/errcodes.h","postgresql:REL8_2_9:src/include/utils/errcodes.h","postgresql:REL8_3_0:src/include/utils/errcodes.h","postgresql:REL8_3_10:src/include/utils/errcodes.h","postgresql:REL8_3_11:src/include/utils/errcodes.h","postgresql:REL8_3_12:src/include/utils/errcodes.h","postgresql:REL8_3_13:src/include/utils/errcodes.h","postgresql:REL8_3_14:src/include/utils/errcodes.h","postgresql:REL8_3_15:src/include/utils/errcodes.h","postgresql:REL8_3_16:src/include/utils/errcodes.h","postgresql:REL8_3_17:src/include/utils/errcodes.h","postgresql:REL8_3_18:src/include/utils/errcodes.h","postgresql:REL8_3_19:src/include/utils/errcodes.h","postgresql:REL8_3_1:src/include/utils/errcodes.h","postgresql:REL8_3_20:src/include/utils/errcodes.h","postgresql:REL8_3_21:src/include/utils/errcodes.h","postgresql:REL8_3_22:src/include/utils/errcodes.h","postgresql:REL8_3_23:src/include/utils/errcodes.h","postgresql:REL8_3_2:src/include/utils/errcodes.h","postgresql:REL8_3_3:src/include/utils/errcodes.h","postgresql:REL8_3_4:src/include/utils/errcodes.h","postgresql:REL8_3_5:src/include/utils/errcodes.h","postgresql:REL8_3_6:src/include/utils/errcodes.h","postgresql:REL8_3_7:src/include/utils/errcodes.h","postgresql:REL8_3_8:src/include/utils/errcodes.h","postgresql:REL8_3_9:src/include/utils/errcodes.h","postgresql:REL8_4_0:src/include/utils/errcodes.h","postgresql:REL8_4_10:src/include/utils/errcodes.h","postgresql:REL8_4_11:src/include/utils/errcodes.h","postgresql:REL8_4_12:src/include/utils/errcodes.h","postgresql:REL8_4_13:src/include/utils/errcodes.h","postgresql:REL8_4_14:src/include/utils/errcodes.h","postgresql:REL8_4_15:src/include/utils/errcodes.h","postgresql:REL8_4_16:src/include/utils/errcodes.h","postgresql:REL8_4_17:src/include/utils/errcodes.h","postgresql:REL8_4_18:src/include/utils/errcodes.h","postgresql:REL8_4_19:src/include/utils/errcodes.h","postgresql:REL8_4_1:src/include/utils/errcodes.h","postgresql:REL8_4_20:src/include/utils/errcodes.h","postgresql:REL8_4_21:src/include/utils/errcodes.h","postgresql:REL8_4_22:src/include/utils/errcodes.h","postgresql:REL8_4_2:src/include/utils/errcodes.h","postgresql:REL8_4_3:src/include/utils/errcodes.h","postgresql:REL8_4_4:src/include/utils/errcodes.h","postgresql:REL8_4_5:src/include/utils/errcodes.h","postgresql:REL8_4_6:src/include/utils/errcodes.h","postgresql:REL8_4_7:src/include/utils/errcodes.h","postgresql:REL8_4_8:src/include/utils/errcodes.h","postgresql:REL8_4_9:src/include/utils/errcodes.h"],"notes":"The old definition path and same-tag documentation were locked for the observed 7.4..8.4 tags; this is a definition presence bound, not a runtime path or precise introducing commit.","scope":"pre9-definition-history","status":"definition_only"}]},"Evidence":[{"Kind":"cases","Ordinal":0,"ID":"dml_unique_conflict","ServerVersion":null,"Status":null,"Payload":{"assertions":["SQLSTATE is 23505","Protocol diagnostics identify the schema, table, and constraint","A successful autocommit connection is IDLE after the error"],"case_id":"dml_unique_conflict","cleanup":"Drop the case schema with an owner connection.","has_snippet":true,"position":0,"preconditions":["A disposable database or schema","One NOT DEFERRABLE unique constraint"],"repair":"Choose a valid key or change the business operation; do not discard the collision implicitly.","trigger":"Insert a second row with the same email value.","versions":["10","18"]}},{"Kind":"cases","Ordinal":1,"ID":"explicit_tx_abort_recovery","ServerVersion":null,"Status":null,"Payload":{"assertions":["The failed transaction is INERROR","The next statement gets 25P02","ROLLBACK restores a usable connection"],"case_id":"explicit_tx_abort_recovery","cleanup":"Drop the case schema with an owner connection.","has_snippet":true,"position":1,"preconditions":["An explicit transaction","One unique constraint"],"repair":"ROLLBACK the transaction, then retry a deliberate valid operation.","trigger":"Cause 23505 after BEGIN, then issue a statement before rollback.","versions":["10","18"]}},{"Kind":"cases","Ordinal":2,"ID":"savepoint_recovery","ServerVersion":null,"Status":null,"Payload":{"assertions":["The failed subtransaction is INERROR","ROLLBACK TO SAVEPOINT restores INTRANS","The outer change and post-savepoint repair both commit"],"case_id":"savepoint_recovery","cleanup":"Drop the case schema with an owner connection.","has_snippet":true,"position":2,"preconditions":["An explicit transaction and SAVEPOINT","One unique constraint"],"repair":"ROLLBACK TO the savepoint and continue with a valid operation.","trigger":"Cause 23505 after a savepoint while an outer change is pending.","versions":["10","18"]}},{"Kind":"cases","Ordinal":3,"ID":"deferred_commit_conflict","ServerVersion":null,"Status":null,"Payload":{"assertions":["The inserts are accepted before COMMIT","COMMIT raises 23505","The failed top-level transaction returns to IDLE and its rows are rolled back"],"case_id":"deferred_commit_conflict","cleanup":"Drop the case schema with an owner connection.","has_snippet":false,"position":3,"preconditions":["A DEFERRABLE INITIALLY DEFERRED unique constraint","Two duplicate rows in one transaction"],"repair":"Make keys unique before COMMIT or roll back and retry the whole transaction.","trigger":"Insert both rows successfully and commit.","versions":["10","18"]}},{"Kind":"cases","Ordinal":4,"ID":"plpgsql_exception_recovery","ServerVersion":null,"Status":null,"Payload":{"assertions":["GET STACKED DIAGNOSTICS reports 23505","The surrounding call succeeds","The handler's repair row commits"],"case_id":"plpgsql_exception_recovery","cleanup":"Drop the function and case schema with an owner connection.","has_snippet":true,"position":4,"preconditions":["PL/pgSQL language","A function that catches unique_violation"],"repair":"Use a narrowly scoped EXCEPTION handler and verify which statement caused the violation.","trigger":"A natural duplicate insert inside the function.","versions":["10","18"]}},{"Kind":"cases","Ordinal":5,"ID":"concurrent_unique_conflict","ServerVersion":null,"Status":null,"Payload":{"assertions":["B is observed waiting on a lock before A commits","B receives 23505 after A commits","B is INERROR until rollback and exactly one row remains"],"case_id":"concurrent_unique_conflict","cleanup":"Roll back both workers if needed, then drop the case schema.","has_snippet":false,"position":5,"preconditions":["Two sessions","A unique index","An observer session reading pg_stat_activity"],"repair":"Coordinate key allocation or retry the complete transaction when the business operation is retryable.","trigger":"Session A holds an uncommitted key while session B inserts the same key.","versions":["10","18"]}},{"Kind":"cases","Ordinal":6,"ID":"on_conflict_target_scope","ServerVersion":null,"Status":null,"Payload":{"assertions":["The targeted email clause does not suppress a phone collision","An omitted-target DO NOTHING handles a usable unique conflict","The result is checked against the intended business policy"],"case_id":"on_conflict_target_scope","cleanup":"Drop the case schema with an owner connection.","has_snippet":true,"position":6,"preconditions":["Separate unique email and phone constraints","A pre-existing phone value"],"repair":"Select the conflict target and DO UPDATE/DO NOTHING policy to match the business invariant; reconcile idempotency requests with the original request and result.","trigger":"Use ON CONFLICT (email) for a row that collides only on phone.","versions":["10","18"]}},{"Kind":"cases","Ordinal":7,"ID":"nulls_not_distinct","ServerVersion":null,"Status":null,"Payload":{"assertions":["The second NULL raises 23505","The diagnostic identifies the explicit constraint","The behavior is not attributed to an upgrade changing the old default"],"case_id":"nulls_not_distinct","cleanup":"Drop the case schema with an owner connection.","has_snippet":false,"position":7,"preconditions":["PostgreSQL 15 or later","UNIQUE NULLS NOT DISTINCT is explicitly declared"],"repair":"Choose NULLS DISTINCT (the default) or NULLS NOT DISTINCT deliberately for the invariant.","trigger":"Insert a second NULL into the explicit NULLS NOT DISTINCT constraint.","versions":["15","16","17","18"]}},{"Kind":"cases","Ordinal":8,"ID":"nulls_not_distinct_version_boundary","ServerVersion":null,"Status":null,"Payload":{"assertions":["Ordinary UNIQUE accepts two NULLs on both targets","PG14 records the actual unsupported syntax diagnostic","PG15 records a natural 23505 for the explicit second NULL and a valid repair"],"case_id":"nulls_not_distinct_version_boundary","cleanup":"Drop the case schema with an owner connection.","has_snippet":true,"position":8,"preconditions":["A disposable PostgreSQL 14 or 15 target","One ordinary UNIQUE and one explicit UNIQUE NULLS NOT DISTINCT declaration"],"repair":"Use the explicit NULL policy deliberately; after the supported duplicate, insert a valid non-duplicate value and verify the connection remains usable.","trigger":"Insert two NULLs under ordinary UNIQUE, then execute the explicit NULLS NOT DISTINCT declaration and, where supported, a second NULL.","versions":["14","15"]}},{"Kind":"cases","Ordinal":9,"ID":"sequence_lag_repair","ServerVersion":null,"Status":null,"Payload":{"assertions":["The stale nextval causes a real 23505","setval(max(id), true) moves the next value to 107 in this controlled case","The result records sequence identity and non-default increment"],"case_id":"sequence_lag_repair","cleanup":"Drop the case schema with an owner connection.","has_snippet":true,"position":9,"preconditions":["A controlled, quiesced case schema","A sequence with START 100 and INCREMENT 7"],"repair":"Inspect the sequence and table, then repair only under a controlled writer-free window; handle an empty table and non-default bounds/increment separately.","trigger":"Insert an explicit key equal to the sequence's first value, then call nextval.","versions":["10","18"]}},{"Kind":"cases","Ordinal":10,"ID":"index_build_conflict","ServerVersion":null,"Status":null,"Payload":{"assertions":["Both failures are 23505 with the index-build message template","The regular build leaves no index","The concurrent failure's actual pg_index state is recorded and is not generalized to every CIC failure"],"case_id":"index_build_conflict","cleanup":"Drop any leftover indexes and the case schema with an owner connection.","has_snippet":false,"position":10,"preconditions":["Duplicate table rows","Owner connection for index cleanup"],"repair":"Resolve duplicates, drop an invalid concurrent index when present, and retry the appropriate build.","trigger":"Build a regular unique index and then a concurrent unique index over duplicate rows.","versions":["10","18"]}},{"Kind":"cases","Ordinal":11,"ID":"diagnostic_visibility","ServerVersion":null,"Status":null,"Payload":{"assertions":["SQLSTATE and protocol object fields remain available","The key detail can be omitted when the role cannot inspect the key columns"],"case_id":"diagnostic_visibility","cleanup":"Drop the role, table, and schema with an owner connection.","has_snippet":false,"position":11,"preconditions":["A restricted login role with INSERT but no SELECT privilege","A seeded unique row"],"repair":"Use permitted diagnostics and server logs; do not assume detail is always present.","trigger":"The restricted role inserts a duplicate key.","versions":["10","18"]}},{"Kind":"cases","Ordinal":12,"ID":"log_fields","ServerVersion":null,"Status":null,"Payload":{"assertions":["CSV/JSON log records expose SQLSTATE, message, and detail","The protocol constraint_name is not treated as a CSV/JSON standard key","The exact emitted record is tied to this run"],"case_id":"log_fields","cleanup":"Stop and remove only the runner-owned cluster or container.","has_snippet":false,"position":12,"preconditions":["A dedicated cluster with logging_collector and csvlog; jsonlog when supported"],"repair":"Correlate logs with SQLSTATE and message fields; obtain object identity from the ErrorResponse or structured server context where available.","trigger":"Cause a duplicate-key error and read the collector output.","versions":["10","18"]}},{"Kind":"claims","Ordinal":0,"ID":"identity.class-and-condition","ServerVersion":null,"Status":null,"Payload":{"claim_id":"identity.class-and-condition","limits":"This establishes directory identity; it does not assert that every possible call site has been executed.","method":"Read the frozen errcodes.txt row and section.","position":0,"runtime":[],"sources":["src.errcodes.18.6"],"statement":"23505 is the unique_violation condition in Class 23 integrity_constraint_violation."}},{"Kind":"claims","Ordinal":1,"ID":"runtime.dml-template","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.dml-template","limits":"The key detail is conditional on permission/RLS and available key values.","method":"Trace ereport and BuildIndexValueDescription in the fixed source snapshot; compare with dml_unique_conflict and diagnostic_visibility runs.","position":1,"runtime":[],"sources":["src.nbtinsert.18.6","src.genam.18.6"],"statement":"The nbtree unique-check path emits SQLSTATE 23505 with duplicate key value violates unique constraint and, when visible, Key ... already exists."}},{"Kind":"claims","Ordinal":2,"ID":"runtime.protocol-fields","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.protocol-fields","limits":"Log formats can gain fields in later releases; constraint_name is not inferred as a standard CSV/JSON key from a protocol field. The earlier full run is retained as a historical audit record but its first-record log_fields selection is excluded from this claim.","method":"Read the protocol field table and CSV/JSON logging field tables; inspect the records selected by the corrected log_fields run using backend PID, schema, table, constraint, message, and detail.","position":2,"runtime":[],"sources":["doc.protocol.18","doc.logging.18"],"statement":"schema_name, table_name, and constraint_name are ErrorResponse object fields, while standard CSV/JSON logs expose SQLSTATE, message, and detail under their logging schemas."}},{"Kind":"claims","Ordinal":3,"ID":"runtime.index-build-template","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.index-build-template","limits":"The invalid-state observation is limited to the duplicate scan failure in this run; other CIC failure stages require separate tests.","method":"Read the index-build ereport and concurrent-build phases; inspect pg_class/pg_index after both real failures.","position":3,"runtime":[],"sources":["src.tuplesortvariants.18.6","doc.create-index.18.6"],"statement":"Unique index construction uses the separate could not create unique index template; a duplicate found in this CIC scan leaves an invalid index row, while this regular failed build leaves no row after rollback."}},{"Kind":"claims","Ordinal":4,"ID":"runtime.logical-apply-sqlstate","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.logical-apply-sqlstate","limits":"No publisher/subscriber topology was run in this batch, so this is source/documentation evidence rather than a runtime observation.","method":"Read ReportApplyConflict and errcode_apply_conflict in the fixed source snapshot and compare the official conflict documentation.","position":4,"runtime":[],"sources":["src.logical-conflict.18.6"],"statement":"PG18 logical apply classifies insert_exists, update_exists, and multiple_unique_conflicts and maps those conflict paths to SQLSTATE 23505."}},{"Kind":"claims","Ordinal":5,"ID":"runtime.tx-contexts","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.tx-contexts","limits":"Connection status names are captured through psycopg 3; other clients may expose equivalent states differently.","method":"Read transaction and PL/pgSQL contracts and assert status transitions in explicit_tx_abort_recovery, savepoint_recovery, deferred_commit_conflict, and plpgsql_exception_recovery.","position":5,"runtime":[],"sources":["doc.transactions.18","doc.plpgsql.18"],"statement":"A 23505 aborts an explicit transaction until rollback, can be isolated with ROLLBACK TO SAVEPOINT, can surface at COMMIT for a deferred unique constraint, and can be caught by a PL/pgSQL EXCEPTION subtransaction."}},{"Kind":"claims","Ordinal":6,"ID":"runtime.retry-boundary","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.retry-boundary","limits":"The case demonstrates the conflict and lock ordering, not that a particular application transaction is safe to retry.","method":"Read the official serialization-failure handling guidance and run an explicit lock-synchronized concurrent unique conflict.","position":6,"runtime":[],"sources":["doc.mvcc.18"],"statement":"PostgreSQL documents cases where 23505 from concurrent key selection can be retried, but the retry must include the complete transaction and may remain a persistent conflict."}},{"Kind":"claims","Ordinal":7,"ID":"runtime.on-conflict-scope","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.on-conflict-scope","limits":"Whether DO NOTHING or DO UPDATE is correct remains a business policy; idempotency requires request and existing-result validation.","method":"Read conflict-target rules and execute the case with a pre-existing phone row.","position":7,"runtime":[],"sources":["doc.insert.18.6"],"statement":"ON CONFLICT (email) only handles its inferred arbiter; a phone-only collision still raises 23505, while omitted-target DO NOTHING handles a usable unique conflict."}},{"Kind":"claims","Ordinal":8,"ID":"runtime.sequence-repair-limit","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.sequence-repair-limit","limits":"Empty tables, sequence identity, bounds, cache, non-default ownership and concurrent writers need separate checks.","method":"Read setval semantics and execute START 100 INCREMENT 7 with a writer-free case schema.","position":8,"runtime":[],"sources":["doc.sequence.18"],"statement":"setval(max(id), true) advances the next value in the controlled non-default increment case, but it is not a universal sequence repair."}},{"Kind":"claims","Ordinal":9,"ID":"runtime.nulls-choice","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.nulls-choice","limits":"The case covers the DDL choice, not an upgrade of an existing catalog across every release.","method":"Execute an explicit NULLS NOT DISTINCT constraint on PG18 and mark the PG10 syntax as not applicable.","position":9,"runtime":[],"sources":["doc.insert.18.6"],"statement":"UNIQUE NULLS NOT DISTINCT is an explicit PG15+ declaration; the default remains NULLS DISTINCT and is not changed merely by upgrading."}},{"Kind":"claims","Ordinal":10,"ID":"runtime.detail-visibility","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.detail-visibility","limits":"Other privileges, RLS policies, expression indexes, and server configuration can change which fields are visible.","method":"Trace ACL/RLS checks and execute diagnostic_visibility with INSERT-only privilege.","position":10,"runtime":[],"sources":["src.genam.18.6"],"statement":"A role without SELECT privilege on unique key columns can receive SQLSTATE and protocol object fields while the key DETAIL is omitted."}},{"Kind":"claims","Ordinal":11,"ID":"runtime.version-boundary","ServerVersion":null,"Status":null,"Payload":{"claim_id":"runtime.version-boundary","limits":"This is a bounded PG14.24/PG15.19 comparison for the explicit NULLS NOT DISTINCT case. The PG14 syntax error is not 23505 coverage, and the result does not replace the selected base 18.6/10.21 case counts or establish every intermediate release.","method":"Compare the two fixed version-boundary summaries for the same registry case, including ordinary NULL behavior, explicit declaration result, transaction status, and repair count.","position":11,"runtime":[],"sources":["doc.insert.18.6","runtime.23505-boundary-pg14-20260909.pg14","runtime.23505-boundary-pg15-20260909.pg15"],"statement":"On the fixed version-boundary registry case, PostgreSQL 14.24 accepts two ordinary NULLs but rejects UNIQUE NULLS NOT DISTINCT with syntax error 42601 and no 23505; PostgreSQL 15.19 accepts the declaration and raises 23505 on the second NULL, then remains IDLE for the valid repair."}},{"Kind":"messages","Ordinal":0,"ID":"message.dml.nbtree","ServerVersion":null,"Status":null,"Payload":{"limits":"Template values and DETAIL depend on relation name and diagnostic visibility.","message_id":"message.dml.nbtree","path":"","position":0,"raw":{"detail_template":"Key %s already exists.","id":"message.dml.nbtree","limits":"Template values and DETAIL depend on relation name and diagnostic visibility.","primary_template":"duplicate key value violates unique constraint \"%s\"","severity_source":"E","sources":["src.nbtinsert.18.6"],"sqlstate":"23505"},"severity":"E","sources":["src.nbtinsert.18.6"],"templates":[{"kind":"primary","literal":"duplicate key value violates unique constraint \" \"","position":0,"role":"","template":"duplicate key value violates unique constraint \"%s\""},{"kind":"detail","literal":"Key already exists.","position":1,"role":"","template":"Key %s already exists."}]}},{"Kind":"messages","Ordinal":1,"ID":"message.index-build","ServerVersion":null,"Status":null,"Payload":{"limits":"This is the unique-index build path, not the ordinary DML template.","message_id":"message.index-build","path":"","position":1,"raw":{"detail_template":"Key %s is duplicated.","id":"message.index-build","limits":"This is the unique-index build path, not the ordinary DML template.","primary_template":"could not create unique index \"%s\"","severity_source":"E","sources":["src.tuplesortvariants.18.6"],"sqlstate":"23505"},"severity":"E","sources":["src.tuplesortvariants.18.6"],"templates":[{"kind":"primary","literal":"could not create unique index \" \"","position":0,"role":"","template":"could not create unique index \"%s\""},{"kind":"detail","literal":"Key is duplicated.","position":1,"role":"","template":"Key %s is duplicated."}]}},{"Kind":"messages","Ordinal":2,"ID":"message.logical-apply","ServerVersion":null,"Status":null,"Payload":{"limits":"The detail is dynamically assembled in err_detail.data and passed through errdetail_internal(\"%s\", err_detail.data); this is not a fixed user-facing template. The PG18 conflict label is source-confirmed; this batch did not run logical replication.","message_id":"message.logical-apply","path":"","position":2,"raw":{"detail_template":"%s","id":"message.logical-apply","limits":"The detail is dynamically assembled in err_detail.data and passed through errdetail_internal(\"%s\", err_detail.data); this is not a fixed user-facing template. The PG18 conflict label is source-confirmed; this batch did not run logical replication.","primary_template":"conflict detected on relation \"%s.%s\": conflict=%s","sources":["src.logical-conflict.18.6"],"sqlstate":"23505"},"severity":"","sources":["src.logical-conflict.18.6"],"templates":[{"kind":"primary","literal":"conflict detected on relation \" . \": conflict=","position":0,"role":"","template":"conflict detected on relation \"%s.%s\": conflict=%s"},{"kind":"detail","literal":"","position":1,"role":"","template":"%s"}]}},{"Kind":"runtimes","Ordinal":0,"ID":"runtime.23505-final-20260909.latest","ServerVersion":"18.6 (Homebrew)","Status":"passed","Payload":{"cases":["deferred_commit_conflict","concurrent_unique_conflict","nulls_not_distinct","index_build_conflict","diagnostic_visibility"],"limits":"The selected cases are the full run scenarios not replaced by a more targeted final record; its former log_fields selection is excluded because the targeted run provides the exact event correlation.","position":0,"raw":{"cases":["deferred_commit_conflict","concurrent_unique_conflict","nulls_not_distinct","index_build_conflict","diagnostic_visibility"],"id":"runtime.23505-final-20260909.latest","limits":"The selected cases are the full run scenarios not replaced by a more targeted final record; its former log_fields selection is excluded because the targeted run provides the exact event correlation.","raw":"verify/results/23505-final-20260909/latest/raw.jsonl","run_id":"23505-final-20260909","selection_status":"selected_for_unreplaced_cases","server_version":"18.6 (Homebrew)","server_version_num":180006,"status":"passed","summary":"verify/results/23505-final-20260909/latest/summary.json","target":"latest"},"run_id":"23505-final-20260909","runtime_id":"runtime.23505-final-20260909.latest","server_version":"18.6 (Homebrew)","status":"passed","target":"latest"}},{"Kind":"runtimes","Ordinal":1,"ID":"runtime.23505-final-20260909.pg10","ServerVersion":"10.21 (Debian 10.21-1.pgdg90+1)","Status":"passed","Payload":{"cases":["deferred_commit_conflict","concurrent_unique_conflict","index_build_conflict","diagnostic_visibility"],"limits":"The selected cases are the full run scenarios not replaced by a more targeted final record; its former log_fields selection is excluded because the targeted run provides the exact event correlation.","position":1,"raw":{"cases":["deferred_commit_conflict","concurrent_unique_conflict","index_build_conflict","diagnostic_visibility"],"cases_not_applicable":["nulls_not_distinct"],"cases_passed":11,"id":"runtime.23505-final-20260909.pg10","image":"postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc","limits":"The selected cases are the full run scenarios not replaced by a more targeted final record; its former log_fields selection is excluded because the targeted run provides the exact event correlation.","raw":"verify/results/23505-final-20260909/pg10/raw.jsonl","run_id":"23505-final-20260909","selection_status":"selected_for_unreplaced_cases","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","server_version_num":100021,"status":"passed","summary":"verify/results/23505-final-20260909/pg10/summary.json","target":"pg10"},"run_id":"23505-final-20260909","runtime_id":"runtime.23505-final-20260909.pg10","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","status":"passed","target":"pg10"}},{"Kind":"runtimes","Ordinal":2,"ID":"runtime.23505-snippet-contract-20260909.latest","ServerVersion":"18.6 (Homebrew)","Status":"passed","Payload":{"cases":["plpgsql_exception_recovery","on_conflict_target_scope","sequence_lag_repair"],"limits":"The selected cases are the registry-backed PL/pgSQL, ON CONFLICT, and sequence excerpts; explicit transaction and savepoint cases use the manual-boundary runs below.","position":2,"raw":{"cases":["plpgsql_exception_recovery","on_conflict_target_scope","sequence_lag_repair"],"id":"runtime.23505-snippet-contract-20260909.latest","limits":"The selected cases are the registry-backed PL/pgSQL, ON CONFLICT, and sequence excerpts; explicit transaction and savepoint cases use the manual-boundary runs below.","raw":"verify/results/23505-snippet-contract-20260909/latest/raw.jsonl","run_id":"23505-snippet-contract-20260909","selection_status":"selected_for_registry_snippets","server_version":"18.6 (Homebrew)","server_version_num":180006,"snippet_registry":"verify/cases/23505/snippets.json","status":"passed","summary":"verify/results/23505-snippet-contract-20260909/latest/summary.json","target":"latest"},"run_id":"23505-snippet-contract-20260909","runtime_id":"runtime.23505-snippet-contract-20260909.latest","server_version":"18.6 (Homebrew)","status":"passed","target":"latest"}},{"Kind":"runtimes","Ordinal":3,"ID":"runtime.23505-snippet-contract-20260909.pg10","ServerVersion":"10.21 (Debian 10.21-1.pgdg90+1)","Status":"passed","Payload":{"cases":["plpgsql_exception_recovery","on_conflict_target_scope","sequence_lag_repair"],"limits":"The selected cases are the registry-backed PL/pgSQL, ON CONFLICT, and sequence excerpts; explicit transaction and savepoint cases use the manual-boundary runs below.","position":3,"raw":{"cases":["plpgsql_exception_recovery","on_conflict_target_scope","sequence_lag_repair"],"id":"runtime.23505-snippet-contract-20260909.pg10","limits":"The selected cases are the registry-backed PL/pgSQL, ON CONFLICT, and sequence excerpts; explicit transaction and savepoint cases use the manual-boundary runs below.","raw":"verify/results/23505-snippet-contract-20260909/pg10/raw.jsonl","run_id":"23505-snippet-contract-20260909","selection_status":"selected_for_registry_snippets","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","server_version_num":100021,"snippet_registry":"verify/cases/23505/snippets.json","status":"passed","summary":"verify/results/23505-snippet-contract-20260909/pg10/summary.json","target":"pg10"},"run_id":"23505-snippet-contract-20260909","runtime_id":"runtime.23505-snippet-contract-20260909.pg10","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","status":"passed","target":"pg10"}},{"Kind":"runtimes","Ordinal":4,"ID":"runtime.23505-log-fields-final-20260909.latest","ServerVersion":"18.6 (Homebrew)","Status":"passed","Payload":{"cases":["log_fields"],"limits":"This targeted run is the sole selected log_fields record; its backend PID, schema, table, constraint, message, and detail match the trigger.","position":4,"raw":{"cases":["log_fields"],"id":"runtime.23505-log-fields-final-20260909.latest","limits":"This targeted run is the sole selected log_fields record; its backend PID, schema, table, constraint, message, and detail match the trigger.","observed":{"backend_pid":60638,"correlation":"Both collector records match this case backend PID, schema, table, constraint, SQLSTATE, primary message, and DETAIL.","csv_record":{"detail":"Key (token)=(logged) already exists.","message":"duplicate key value violates unique constraint \"logged_items_token_key\"","process_id":"60638","query":"INSERT INTO \"c23505_log_fields\".\"logged_items\" VALUES (2, 'logged')","sql_state_code":"23505"},"json_record":{"detail":"Key (token)=(logged) already exists.","message":"duplicate key value violates unique constraint \"logged_items_token_key\"","pid":60638,"state_code":"23505","statement":"INSERT INTO \"c23505_log_fields\".\"logged_items\" VALUES (2, 'logged')"},"trigger":{"constraint_name":"logged_items_token_key","message_detail":"Key (token)=(logged) already exists.","message_primary":"duplicate key value violates unique constraint \"logged_items_token_key\"","schema_name":"c23505_log_fields","sqlstate":"23505","table_name":"logged_items"}},"raw":"verify/results/23505-log-fields-final-20260909/latest/raw.jsonl","raw_sha256":"91945d2220cb85882275675810fb9b85382e99a6b25b2e81e6d06e7751b8553f","run_id":"23505-log-fields-final-20260909","selection_status":"selected_exact_log_correlation","server_version":"18.6 (Homebrew)","server_version_num":180006,"snippet_registry":{"path":"verify/cases/23505/snippets.json","sha256":"74d7d700331bc3d9c190bf807cca31999ddf45e8cbea153ec7c6b6d4f9702686"},"status":"passed","summary":"verify/results/23505-log-fields-final-20260909/latest/summary.json","summary_sha256":"4f398c31188efa509cc59f010e4cbac23751a48deac973a027ecb66903c8c817","target":"latest"},"run_id":"23505-log-fields-final-20260909","runtime_id":"runtime.23505-log-fields-final-20260909.latest","server_version":"18.6 (Homebrew)","status":"passed","target":"latest"}},{"Kind":"runtimes","Ordinal":5,"ID":"runtime.23505-log-fields-final-20260909.pg10","ServerVersion":"10.21 (Debian 10.21-1.pgdg90+1)","Status":"passed","Payload":{"cases":["log_fields"],"limits":"This targeted run is the sole selected log_fields record; its backend PID, schema, table, constraint, message, and detail match the trigger.","position":5,"raw":{"cases":["log_fields"],"id":"runtime.23505-log-fields-final-20260909.pg10","image":"postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc","limits":"This targeted run is the sole selected log_fields record; its backend PID, schema, table, constraint, message, and detail match the trigger.","observed":{"backend_pid":81,"correlation":"The CSV collector record matches this case backend PID, schema, table, constraint, SQLSTATE, primary message, and DETAIL; PG10 has no JSON logging output in this target configuration.","csv_record":{"detail":"Key (token)=(logged) already exists.","message":"duplicate key value violates unique constraint \"logged_items_token_key\"","process_id":"81","query":"INSERT INTO \"c23505_log_fields\".\"logged_items\" VALUES (2, 'logged')","sql_state_code":"23505"},"json_record":null,"trigger":{"constraint_name":"logged_items_token_key","message_detail":"Key (token)=(logged) already exists.","message_primary":"duplicate key value violates unique constraint \"logged_items_token_key\"","schema_name":"c23505_log_fields","sqlstate":"23505","table_name":"logged_items"}},"raw":"verify/results/23505-log-fields-final-20260909/pg10/raw.jsonl","raw_sha256":"fc52475937c24be583212464ff74a70603118680f5d39b7e2938118473223711","run_id":"23505-log-fields-final-20260909","selection_status":"selected_exact_log_correlation","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","server_version_num":100021,"snippet_registry":{"path":"verify/cases/23505/snippets.json","sha256":"74d7d700331bc3d9c190bf807cca31999ddf45e8cbea153ec7c6b6d4f9702686"},"status":"passed","summary":"verify/results/23505-log-fields-final-20260909/pg10/summary.json","summary_sha256":"d24ef7ce7c8a40cba28b0b5952b404df6feee8038a9e531062885a852b3f77e9","target":"pg10"},"run_id":"23505-log-fields-final-20260909","runtime_id":"runtime.23505-log-fields-final-20260909.pg10","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","status":"passed","target":"pg10"}},{"Kind":"runtimes","Ordinal":6,"ID":"runtime.23505-diagnostic-snippet-20260909.latest","ServerVersion":"18.6 (Homebrew)","Status":"passed","Payload":{"cases":["dml_unique_conflict"],"limits":"The selected DML diagnostic case is the targeted registry run; the broad base-run copy is retained only as local audit data.","position":6,"raw":{"cases":["dml_unique_conflict"],"id":"runtime.23505-diagnostic-snippet-20260909.latest","limits":"The selected DML diagnostic case is the targeted registry run; the broad base-run copy is retained only as local audit data.","raw":"verify/results/23505-diagnostic-snippet-20260909/latest/raw.jsonl","run_id":"23505-diagnostic-snippet-20260909","selection_status":"selected_for_dml_diagnostic","server_version":"18.6 (Homebrew)","server_version_num":180006,"snippet_registry":"verify/cases/23505/snippets.json","status":"passed","summary":"verify/results/23505-diagnostic-snippet-20260909/latest/summary.json","target":"latest"},"run_id":"23505-diagnostic-snippet-20260909","runtime_id":"runtime.23505-diagnostic-snippet-20260909.latest","server_version":"18.6 (Homebrew)","status":"passed","target":"latest"}},{"Kind":"runtimes","Ordinal":7,"ID":"runtime.23505-diagnostic-snippet-20260909.pg10","ServerVersion":"10.21 (Debian 10.21-1.pgdg90+1)","Status":"passed","Payload":{"cases":["dml_unique_conflict"],"limits":"The selected DML diagnostic case is the targeted registry run; the broad base-run copy is retained only as local audit data.","position":7,"raw":{"cases":["dml_unique_conflict"],"id":"runtime.23505-diagnostic-snippet-20260909.pg10","limits":"The selected DML diagnostic case is the targeted registry run; the broad base-run copy is retained only as local audit data.","raw":"verify/results/23505-diagnostic-snippet-20260909/pg10/raw.jsonl","run_id":"23505-diagnostic-snippet-20260909","selection_status":"selected_for_dml_diagnostic","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","server_version_num":100021,"snippet_registry":"verify/cases/23505/snippets.json","status":"passed","summary":"verify/results/23505-diagnostic-snippet-20260909/pg10/summary.json","target":"pg10"},"run_id":"23505-diagnostic-snippet-20260909","runtime_id":"runtime.23505-diagnostic-snippet-20260909.pg10","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","status":"passed","target":"pg10"}},{"Kind":"runtimes","Ordinal":8,"ID":"runtime.23505-explicit-manual-final-20260909.latest","ServerVersion":"18.6 (Homebrew)","Status":"passed","Payload":{"cases":["explicit_tx_abort_recovery"],"limits":"This run proves that registry transaction statements execute with autocommit=True, so psycopg does not add an implicit BEGIN; it covers this explicit recovery case only.","position":8,"raw":{"cases":["explicit_tx_abort_recovery"],"id":"runtime.23505-explicit-manual-final-20260909.latest","limits":"This run proves that registry transaction statements execute with autocommit=True, so psycopg does not add an implicit BEGIN; it covers this explicit recovery case only.","observed":{"connection_autocommit":true,"duplicate_sqlstate":"23505","repair_transaction":"BEGIN; INSERT; COMMIT","rows":[[1,"seed"],[2,"after rollback"]],"status_after_25p02":"INERROR","status_after_duplicate":"INERROR","status_after_rollback":"IDLE","transaction_control":["BEGIN","ROLLBACK","BEGIN","COMMIT"]},"raw":"verify/results/23505-explicit-manual-final-20260909/latest/raw.jsonl","raw_sha256":"586bacd10d1e5d2a5a5ec58c2ed747d4b2b8618a051ce56b0d8307c7265e196d","run_id":"23505-explicit-manual-final-20260909","selection_status":"selected_manual_boundary","server_version":"18.6 (Homebrew)","server_version_num":180006,"snippet_registry":{"path":"verify/cases/23505/snippets.json","sha256":"74d7d700331bc3d9c190bf807cca31999ddf45e8cbea153ec7c6b6d4f9702686"},"status":"passed","summary":"verify/results/23505-explicit-manual-final-20260909/latest/summary.json","summary_sha256":"38cd0161a97fa35084f192a5aa60f6061955b60ec681c4800b575514dee6a6f3","target":"latest"},"run_id":"23505-explicit-manual-final-20260909","runtime_id":"runtime.23505-explicit-manual-final-20260909.latest","server_version":"18.6 (Homebrew)","status":"passed","target":"latest"}},{"Kind":"runtimes","Ordinal":9,"ID":"runtime.23505-explicit-manual-final-20260909.pg10","ServerVersion":"10.21 (Debian 10.21-1.pgdg90+1)","Status":"passed","Payload":{"cases":["explicit_tx_abort_recovery"],"limits":"This run proves that registry transaction statements execute with autocommit=True, so psycopg does not add an implicit BEGIN; it covers this explicit recovery case only.","position":9,"raw":{"cases":["explicit_tx_abort_recovery"],"id":"runtime.23505-explicit-manual-final-20260909.pg10","image":"postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc","limits":"This run proves that registry transaction statements execute with autocommit=True, so psycopg does not add an implicit BEGIN; it covers this explicit recovery case only.","observed":{"connection_autocommit":true,"duplicate_sqlstate":"23505","repair_transaction":"BEGIN; INSERT; COMMIT","rows":[[1,"seed"],[2,"after rollback"]],"status_after_25p02":"INERROR","status_after_duplicate":"INERROR","status_after_rollback":"IDLE","transaction_control":["BEGIN","ROLLBACK","BEGIN","COMMIT"]},"raw":"verify/results/23505-explicit-manual-final-20260909/pg10/raw.jsonl","raw_sha256":"ed1c4f5082a00b67297a9d01b8362f7d70c758a2fbd393e20def6c450a6f5739","run_id":"23505-explicit-manual-final-20260909","selection_status":"selected_manual_boundary","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","server_version_num":100021,"snippet_registry":{"path":"verify/cases/23505/snippets.json","sha256":"74d7d700331bc3d9c190bf807cca31999ddf45e8cbea153ec7c6b6d4f9702686"},"status":"passed","summary":"verify/results/23505-explicit-manual-final-20260909/pg10/summary.json","summary_sha256":"4a4243d367afd9c142991aba496336c972e4fe3cc959a724d3454773986ac30b","target":"pg10"},"run_id":"23505-explicit-manual-final-20260909","runtime_id":"runtime.23505-explicit-manual-final-20260909.pg10","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","status":"passed","target":"pg10"}},{"Kind":"runtimes","Ordinal":10,"ID":"runtime.23505-savepoint-manual-final-20260909.latest","ServerVersion":"18.6 (Homebrew)","Status":"passed","Payload":{"cases":["savepoint_recovery"],"limits":"This run proves the registry savepoint sequence executes with autocommit=True, so psycopg does not add an implicit BEGIN; it covers savepoint recovery only.","position":10,"raw":{"cases":["savepoint_recovery"],"id":"runtime.23505-savepoint-manual-final-20260909.latest","limits":"This run proves the registry savepoint sequence executes with autocommit=True, so psycopg does not add an implicit BEGIN; it covers savepoint recovery only.","observed":{"connection_autocommit":true,"rows":[[1,"seed"],[2,"outer"],[3,"after savepoint"]],"statuses":{"after_duplicate":"INERROR","after_rollback_to_savepoint":"INTRANS"},"transaction_control":["BEGIN","SAVEPOINT","ROLLBACK TO SAVEPOINT","RELEASE SAVEPOINT","COMMIT"]},"raw":"verify/results/23505-savepoint-manual-final-20260909/latest/raw.jsonl","raw_sha256":"3b3e7305df8d70309f3c632e9b19b43cd9f1411f0967e952bff7997e5c0c7cb7","run_id":"23505-savepoint-manual-final-20260909","selection_status":"selected_manual_boundary","server_version":"18.6 (Homebrew)","server_version_num":180006,"snippet_registry":{"path":"verify/cases/23505/snippets.json","sha256":"74d7d700331bc3d9c190bf807cca31999ddf45e8cbea153ec7c6b6d4f9702686"},"status":"passed","summary":"verify/results/23505-savepoint-manual-final-20260909/latest/summary.json","summary_sha256":"e9ff818a677f577321fb2faccb8d48bb62b054d9f579531a5231029cb16162ef","target":"latest"},"run_id":"23505-savepoint-manual-final-20260909","runtime_id":"runtime.23505-savepoint-manual-final-20260909.latest","server_version":"18.6 (Homebrew)","status":"passed","target":"latest"}},{"Kind":"runtimes","Ordinal":11,"ID":"runtime.23505-savepoint-manual-final-20260909.pg10","ServerVersion":"10.21 (Debian 10.21-1.pgdg90+1)","Status":"passed","Payload":{"cases":["savepoint_recovery"],"limits":"This run proves the registry savepoint sequence executes with autocommit=True, so psycopg does not add an implicit BEGIN; it covers savepoint recovery only.","position":11,"raw":{"cases":["savepoint_recovery"],"id":"runtime.23505-savepoint-manual-final-20260909.pg10","image":"postgres@sha256:b2baf8998630663d21370da06387c950e587071bdd307ee34e661cdcc7442bcc","limits":"This run proves the registry savepoint sequence executes with autocommit=True, so psycopg does not add an implicit BEGIN; it covers savepoint recovery only.","observed":{"connection_autocommit":true,"rows":[[1,"seed"],[2,"outer"],[3,"after savepoint"]],"statuses":{"after_duplicate":"INERROR","after_rollback_to_savepoint":"INTRANS"},"transaction_control":["BEGIN","SAVEPOINT","ROLLBACK TO SAVEPOINT","RELEASE SAVEPOINT","COMMIT"]},"raw":"verify/results/23505-savepoint-manual-final-20260909/pg10/raw.jsonl","raw_sha256":"74fb5d36973e351dead8e49c02f2e272979c0dae5d40fc6b631a9ea6f25c5742","run_id":"23505-savepoint-manual-final-20260909","selection_status":"selected_manual_boundary","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","server_version_num":100021,"snippet_registry":{"path":"verify/cases/23505/snippets.json","sha256":"74d7d700331bc3d9c190bf807cca31999ddf45e8cbea153ec7c6b6d4f9702686"},"status":"passed","summary":"verify/results/23505-savepoint-manual-final-20260909/pg10/summary.json","summary_sha256":"9f6dea66d73191045e35fe239ecff2c69fb046bdd90de5cc4351443f3bc0f4bf","target":"pg10"},"run_id":"23505-savepoint-manual-final-20260909","runtime_id":"runtime.23505-savepoint-manual-final-20260909.pg10","server_version":"10.21 (Debian 10.21-1.pgdg90+1)","status":"passed","target":"pg10"}},{"Kind":"runtimes","Ordinal":12,"ID":"runtime.23505-boundary-pg14-20260909.pg14","ServerVersion":"14.24 (Debian 14.24-1.pgdg13+2)","Status":"not_applicable","Payload":{"cases":["nulls_not_distinct_version_boundary"],"limits":"The same registry case passed its assertions, but this target cannot execute the explicit feature. Its 42601 result is retained as a version-availability comparison and is not counted as an observed 23505 runtime.","position":12,"raw":{"case_manifest":{"path":"verify/cases/23505/cases.json","sha256":"e4d9376fa038675dcfd83c3fb3590b2bc43bb897dd5521be11474a7df0334776"},"case_status":"passed","cases":["nulls_not_distinct_version_boundary"],"id":"runtime.23505-boundary-pg14-20260909.pg14","limits":"The same registry case passed its assertions, but this target cannot execute the explicit feature. Its 42601 result is retained as a version-availability comparison and is not counted as an observed 23505 runtime.","observed":{"explicit_feature":"unsupported_syntax","natural_23505_observed":false,"ordinary_unique_null_count":2,"status_after_syntax":"IDLE","unsupported_primary":"syntax error at or near \"NULLS\"","unsupported_severity":"ERROR","unsupported_sqlstate":"42601"},"raw":"verify/results/23505-boundary-pg14-20260909/pg14/raw.jsonl","raw_sha256":"d21fcb5f18c65a8e941814b8c4046b84700c59ce14b73ced51d2f8ac574552fc","run_id":"23505-boundary-pg14-20260909","selection_status":"selected_boundary_comparison","server_version":"14.24 (Debian 14.24-1.pgdg13+2)","server_version_num":140024,"snippet_registry":{"path":"verify/cases/23505/snippets.json","sha256":"2535a5a74138b3e7896f1d06e1109be42f62a49b4dac25e3f842d60c30b21a95"},"status":"not_applicable","summary":"verify/results/23505-boundary-pg14-20260909/pg14/summary.json","summary_sha256":"e757ffaea0ee44d8f5ee5f4187798809d0c63a40020ff575a763e4cabb960f75","target":"pg14","target_status":"passed"},"run_id":"23505-boundary-pg14-20260909","runtime_id":"runtime.23505-boundary-pg14-20260909.pg14","server_version":"14.24 (Debian 14.24-1.pgdg13+2)","status":"not_applicable","target":"pg14"}},{"Kind":"runtimes","Ordinal":13,"ID":"runtime.23505-boundary-pg15-20260909.pg15","ServerVersion":"15.19 (Debian 15.19-1.pgdg13+2)","Status":"passed","Payload":{"cases":["nulls_not_distinct_version_boundary"],"limits":"This is a separate PG15 boundary comparison for the explicit NULLS NOT DISTINCT case; it does not replace or inflate the selected base runtime cases.","position":13,"raw":{"case_manifest":{"path":"verify/cases/23505/cases.json","sha256":"e4d9376fa038675dcfd83c3fb3590b2bc43bb897dd5521be11474a7df0334776"},"case_status":"passed","cases":["nulls_not_distinct_version_boundary"],"id":"runtime.23505-boundary-pg15-20260909.pg15","limits":"This is a separate PG15 boundary comparison for the explicit NULLS NOT DISTINCT case; it does not replace or inflate the selected base runtime cases.","observed":{"explicit_constraint":"nulls_not_distinct_uq","explicit_detail":"Key (external_id)=(null) already exists.","explicit_feature":"supported","explicit_primary":"duplicate key value violates unique constraint \"nulls_not_distinct_uq\"","explicit_severity":"ERROR","explicit_sqlstate":"23505","natural_23505_observed":true,"ordinary_unique_null_count":2,"repaired_row_count":2,"status_after_duplicate":"IDLE"},"raw":"verify/results/23505-boundary-pg15-20260909/pg15/raw.jsonl","raw_sha256":"d2bd7a499b4c9355f209e0831b3dbba8bcc98c8149010dcc9f13135ae05ed97a","run_id":"23505-boundary-pg15-20260909","selection_status":"selected_boundary_comparison","server_version":"15.19 (Debian 15.19-1.pgdg13+2)","server_version_num":150019,"snippet_registry":{"path":"verify/cases/23505/snippets.json","sha256":"2535a5a74138b3e7896f1d06e1109be42f62a49b4dac25e3f842d60c30b21a95"},"status":"passed","summary":"verify/results/23505-boundary-pg15-20260909/pg15/summary.json","summary_sha256":"df4d1f90eaca2155359bc7b141734a1026d7e1893400e5e6352ac1e95461137d","target":"pg15","target_status":"passed"},"run_id":"23505-boundary-pg15-20260909","runtime_id":"runtime.23505-boundary-pg15-20260909.pg15","server_version":"15.19 (Debian 15.19-1.pgdg13+2)","status":"passed","target":"pg15"}},{"Kind":"sources","Ordinal":0,"ID":"src.errcodes.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"lines 235-241","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"}},{"Kind":"sources","Ordinal":1,"ID":"src.nbtinsert.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"lines 640-674","path":"src/backend/access/nbtree/nbtinsert.c","position":1,"sha256":"199671bec6b07b80100ea41632cef4b03a9525df75a2ede2b8fe155b637dcba7","source_id":"src.nbtinsert.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/nbtree/nbtinsert.c#L640-L674"}},{"Kind":"sources","Ordinal":2,"ID":"src.genam.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"lines 155-275","path":"src/backend/access/index/genam.c","position":2,"sha256":"11897b1d8b1ae1f4a1bef9a72e740da7aa83579abf84e4ca5ebacd6530874c28","source_id":"src.genam.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/access/index/genam.c#L155-L275"}},{"Kind":"sources","Ordinal":3,"ID":"src.tuplesortvariants.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"lines 1670-1694","path":"src/backend/utils/sort/tuplesortvariants.c","position":3,"sha256":"f160e11ec100be7e05db8abba7587e8fd0e092110d56f917d2d4dac0a58261ca","source_id":"src.tuplesortvariants.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/utils/sort/tuplesortvariants.c#L1670-L1694"}},{"Kind":"sources","Ordinal":4,"ID":"src.logical-conflict.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"lines 102-131, 168-180","path":"src/backend/replication/logical/conflict.c","position":4,"sha256":"1dc6959872c84bc0d0b402ab48c4050dd961185574971633bd698eadc1a56347","source_id":"src.logical-conflict.18.6","tag":"REL_18_6","url":"https://github.com/postgres/postgres/blob/724edf9bde9d356724ad384a2e196edc3c9f80f7/src/backend/replication/logical/conflict.c#L102-L180"}},{"Kind":"sources","Ordinal":5,"ID":"doc.insert.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"lines 363-430, 564-577","path":"doc/src/sgml/ref/insert.sgml","position":5,"sha256":"f93403779fb1d980cd5995a1e2741bbdae8404584407610f9aba33ec4724a39f","source_id":"doc.insert.18.6","tag":"REL_18_6","url":"https://www.postgresql.org/docs/18/sql-insert.html"}},{"Kind":"sources","Ordinal":6,"ID":"doc.create-index.18.6","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"lines 620-683","path":"doc/src/sgml/ref/create_index.sgml","position":6,"sha256":"3698f11c6f447d127e4624a1a845dee4d5146b8337ddc6d895a7962e676717f8","source_id":"doc.create-index.18.6","tag":"REL_18_6","url":"https://www.postgresql.org/docs/18/sql-createindex.html"}},{"Kind":"sources","Ordinal":7,"ID":"doc.protocol.18","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"ErrorResponse field reference","path":"doc/src/sgml/protocol.sgml","position":7,"sha256":"2531c535a61c7d3bb15ea328aa249317a3d2cf069f5d0d945dce428af845ddfc","source_id":"doc.protocol.18","tag":"PG18-docs","url":"https://www.postgresql.org/docs/18/protocol-error-fields.html"}},{"Kind":"sources","Ordinal":8,"ID":"doc.logging.18","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"CSV and JSON logging fields","path":"doc/src/sgml/config.sgml","position":8,"sha256":"19c5d1126df83008f073ef52fcb45caf8ec511c6ac1ae231def833ea1711d0c9","source_id":"doc.logging.18","tag":"PG18-docs","url":"https://www.postgresql.org/docs/18/runtime-config-logging.html"}},{"Kind":"sources","Ordinal":9,"ID":"doc.mvcc.18","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"serialization and deadlock failure handling","path":"doc/src/sgml/mvcc.sgml","position":9,"sha256":"4b7bf77ee0af4b86052330ff2421d567df3604b75fe7d4f522bec84fdea87340","source_id":"doc.mvcc.18","tag":"PG18-docs","url":"https://www.postgresql.org/docs/18/mvcc-serialization-failure-handling.html"}},{"Kind":"sources","Ordinal":10,"ID":"doc.plpgsql.18","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"EXCEPTION blocks and upsert example","path":"doc/src/sgml/plpgsql.sgml","position":10,"sha256":"43d705adbded343336341fd3e34ea8940432e8a8211f737d36ba3041ad0a4a51","source_id":"doc.plpgsql.18","tag":"PG18-docs","url":"https://www.postgresql.org/docs/18/plpgsql-control-structures.html"}},{"Kind":"sources","Ordinal":11,"ID":"doc.sequence.18","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"setval(regclass,bigint[,boolean])","path":"doc/src/sgml/func.sgml","position":11,"sha256":"05d03f505dc3c3b4fb2b3a6e8ed3275c425306a8ff20dd9548e838c26bbb968a","source_id":"doc.sequence.18","tag":"PG18-docs","url":"https://www.postgresql.org/docs/18/functions-sequence.html"}},{"Kind":"sources","Ordinal":12,"ID":"doc.transactions.18","ServerVersion":null,"Status":null,"Payload":{"commit":"724edf9bde9d356724ad384a2e196edc3c9f80f7","docs_url":"","kind":"","location":"savepoint and transaction recovery","path":"doc/src/sgml/xact.sgml","position":12,"sha256":"b48fbe8bd02ce3d1181a350c88c8baa6e11c73edc90a936e77b180daef328c5c","source_id":"doc.transactions.18","tag":"PG18-docs","url":"https://www.postgresql.org/docs/18/tutorial-transactions.html"}}]}
