{
  "schema": 1,
  "entries": [
    {
      "sqlstate": "01000",
      "condition_name": "warning",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "generic_warning_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A disposable session with a notice handler"
          ],
          "trigger": "Execute a PL/pgSQL RAISE WARNING dispatch probe.",
          "assertions": [
            "The notice handler receives SQLSTATE 01000 and WARNING severity",
            "The warning message is preserved",
            "The session remains IDLE and a follow-up query succeeds",
            "The probe is not presented as the hstore_compat.c natural warning path"
          ],
          "repair": "Treat the warning's message and context as the actionable signal; identify the emitting subsystem before changing data.",
          "cleanup": "No persistent runtime resources are created."
        }
      ]
    },
    {
      "sqlstate": "08000",
      "condition_name": "connection_exception",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": false
        },
        "pg10": {
          "image": "postgres:10",
          "required": false
        }
      },
      "cases": [
        {
          "id": "source_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned only if a source-boundary smoke run is requested."
          ],
          "trigger": "No artificial SQL trigger is executed; this record preserves the fixed source/definition boundary.",
          "assertions": [],
          "repair": "Use the concrete source path or component-specific documentation when it applies.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "08001",
      "condition_name": "sqlclient_unable_to_establish_sqlconnection",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "dblink_connect_failure",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Connect to a runner-local refused port through server-side dblink.",
          "assertions": [
            "The selected server diagnostic has the expected SQLSTATE",
            "The selected recovery/probe assertions pass",
            "Runner-owned resources are cleaned up"
          ],
          "repair": "Follow the case-specific repair statements and verify the resulting state.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "08003",
      "condition_name": "connection_does_not_exist",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "dblink_missing_connection",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Look up a dblink name that was never opened.",
          "assertions": [
            "The selected server diagnostic has the expected SQLSTATE",
            "The selected recovery/probe assertions pass",
            "Runner-owned resources are cleaned up"
          ],
          "repair": "Follow the case-specific repair statements and verify the resulting state.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "08004",
      "condition_name": "sqlserver_rejected_establishment_of_sqlconnection",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": false
        },
        "pg10": {
          "image": "postgres:10",
          "required": false
        }
      },
      "cases": [
        {
          "id": "source_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned only if a source-boundary smoke run is requested."
          ],
          "trigger": "No artificial SQL trigger is executed; this record preserves the fixed source/definition boundary.",
          "assertions": [],
          "repair": "Use the concrete source path or component-specific documentation when it applies.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "08006",
      "condition_name": "connection_failure",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": false
        },
        "pg10": {
          "image": "postgres:10",
          "required": false
        }
      },
      "cases": [
        {
          "id": "source_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned only if a source-boundary smoke run is requested."
          ],
          "trigger": "No artificial SQL trigger is executed; this record preserves the fixed source/definition boundary.",
          "assertions": [],
          "repair": "Use the concrete source path or component-specific documentation when it applies.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "08007",
      "condition_name": "transaction_resolution_unknown",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": false
        },
        "pg10": {
          "image": "postgres:10",
          "required": false
        }
      },
      "cases": [
        {
          "id": "source_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned only if a source-boundary smoke run is requested."
          ],
          "trigger": "No artificial SQL trigger is executed; this record preserves the fixed source/definition boundary.",
          "assertions": [],
          "repair": "Use the concrete source path or component-specific documentation when it applies.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "08P01",
      "condition_name": "protocol_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "protocol_violation",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Complete a startup handshake, then send a correctly framed unknown frontend message type.",
          "assertions": [
            "The selected server diagnostic has the expected SQLSTATE",
            "The selected recovery/probe assertions pass",
            "Runner-owned resources are cleaned up"
          ],
          "repair": "Follow the case-specific repair statements and verify the resulting state.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "0A000",
      "condition_name": "feature_not_supported",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "hash_index_feature",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Use ASC with the hash access method, then create the same index without ordering.",
          "assertions": [
            "The selected server diagnostic has the expected SQLSTATE",
            "The selected recovery/probe assertions pass",
            "Runner-owned resources are cleaned up"
          ],
          "repair": "Follow the case-specific repair statements and verify the resulting state.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "0L000",
      "condition_name": "invalid_grantor",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": false
        },
        "pg10": {
          "image": "postgres:10",
          "required": false
        }
      },
      "cases": [
        {
          "id": "source_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned only if a source-boundary smoke run is requested."
          ],
          "trigger": "No artificial SQL trigger is executed; this record preserves the fixed source/definition boundary.",
          "assertions": [],
          "repair": "Use the concrete source path or component-specific documentation when it applies.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "0LP01",
      "condition_name": "invalid_grant_operation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_grant_operation",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Grant an invalid sequence privilege, then grant USAGE to a disposable role.",
          "assertions": [
            "The selected server diagnostic has the expected SQLSTATE",
            "The selected recovery/probe assertions pass",
            "Runner-owned resources are cleaned up"
          ],
          "repair": "Follow the case-specific repair statements and verify the resulting state.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "0P000",
      "condition_name": "invalid_role_specification",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": false
        },
        "pg10": {
          "image": "postgres:10",
          "required": false
        }
      },
      "cases": [
        {
          "id": "source_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned only if a source-boundary smoke run is requested."
          ],
          "trigger": "No artificial SQL trigger is executed; this record preserves the fixed source/definition boundary.",
          "assertions": [],
          "repair": "Use the concrete source path or component-specific documentation when it applies.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "21000",
      "condition_name": "cardinality_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "scalar_subquery_cardinality",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A disposable table contains two source rows",
            "The scalar subquery is expected to return at most one row"
          ],
          "trigger": "Use a two-row subquery in a scalar expression.",
          "assertions": [
            "SQLSTATE is 21000",
            "The connection remains usable after the autocommit error",
            "A one-row predicate succeeds afterward"
          ],
          "repair": "Make the scalar relation one row by predicate, aggregation, or an explicit application rule; do not add LIMIT without defining which row is correct.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "22001",
      "condition_name": "string_data_right_truncation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "varchar_width_overflow",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [],
          "trigger": "Insert a value longer than the declared varchar(3) width.",
          "assertions": [
            "SQLSTATE is 22001",
            "The varchar width diagnostic names character varying(3)",
            "The failed autocommit session remains IDLE",
            "A representable value is stored after the error"
          ],
          "repair": "Use a value that satisfies the declared width or revise the data contract explicitly; do not rely on an explicit cast that silently truncates the input.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "22003",
      "condition_name": "numeric_value_out_of_range",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "integer_out_of_range",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [],
          "trigger": "Cast the decimal text 2147483648 to the target integer type.",
          "assertions": [
            "SQLSTATE is 22003",
            "The diagnostic identifies integer range overflow",
            "The failed autocommit session remains IDLE",
            "A representable int4 value succeeds afterward"
          ],
          "repair": "Use a representable integer or choose a wider numeric type after checking the business range; do not treat a conversion error as a generic data truncation.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "22004",
      "condition_name": "null_value_not_allowed",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "xmltable_null_namespace",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [],
          "trigger": "Evaluate XMLTABLE with a NULL namespace URI.",
          "assertions": [
            "SQLSTATE is 22004",
            "The diagnostic identifies the XMLTABLE namespace URI",
            "The failed autocommit session remains IDLE",
            "A non-NULL namespace URI returns one row afterward"
          ],
          "repair": "Supply the namespace URI required by the XML document and keep this XMLTABLE path distinct from a table-column NOT NULL violation.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "22007",
      "condition_name": "invalid_datetime_format",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_interval_format",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [],
          "trigger": "Format an interval with the date-only field ID, which is not defined for intervals.",
          "assertions": [
            "SQLSTATE is 22007",
            "The diagnostic and HINT identify the interval format restriction",
            "The failed autocommit session remains IDLE",
            "A valid interval format returns the expected value afterward"
          ],
          "repair": "Use an interval-compatible format such as DD, or convert a value whose semantics really require a calendar date before formatting.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "22012",
      "condition_name": "division_by_zero",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "division_by_zero_numeric",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Evaluate a numeric expression with a zero denominator.",
          "assertions": [
            "SQLSTATE is 22012 with primary division by zero",
            "The failed autocommit session remains IDLE",
            "A nonzero denominator returns the defined numeric result"
          ],
          "repair": "Validate the denominator or apply an explicitly chosen domain policy; do not silently turn a calculation into NULL with NULLIF unless that is the intended business result.",
          "cleanup": "Close the runner connection and drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "22023",
      "condition_name": "invalid_parameter_value",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_work_mem_parameter",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Set the built-in work_mem parameter to the invalid memory-size text not-a-memory-size.",
          "assertions": [
            "SQLSTATE is 22023 with the invalid work_mem value diagnostic",
            "The failed autocommit session remains IDLE",
            "A valid work_mem value is accepted in the same session and SHOW reports 1MB"
          ],
          "repair": "Set work_mem to a valid memory value in the same session; do not interpret a parameter-value error as a connection failure.",
          "cleanup": "Close the runner connection and drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "2202E",
      "condition_name": "array_subscript_error",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "incompatible_array_dimensions",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A dedicated autocommit connection"
          ],
          "trigger": "Concatenate two arrays whose element dimensions are incompatible.",
          "assertions": [
            "SQLSTATE is 2202E",
            "The diagnostic explains the incompatible dimensions",
            "A valid array operation succeeds afterward"
          ],
          "repair": "Validate rank, bounds, and element dimensions before concatenation or assignment.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "22P02",
      "condition_name": "invalid_text_representation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_integer_text",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Cast non-numeric text to integer, then cast a valid integer text on the same connection.",
          "assertions": [
            "SQLSTATE is 22P02 with ERROR severity",
            "The primary diagnostic identifies invalid integer input and the supplied text",
            "The failed autocommit session remains IDLE",
            "A valid integer text returns 42 afterward"
          ],
          "repair": "Validate or reject input before casting; if the input is valid, cast it to the intended type and keep the business validation separate from syntax recovery.",
          "cleanup": "Close all runner connections and drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "23001",
      "condition_name": "restrict_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "restrict_delete_referenced_parent",
          "versions": [
            "18"
          ],
          "preconditions": [
            "A child row references a parent through ON DELETE RESTRICT",
            "The parent delete is attempted while the child remains"
          ],
          "trigger": "Delete the referenced parent row.",
          "assertions": [
            "SQLSTATE is 23001",
            "The RESTRICT constraint and referencing table are identified",
            "Deleting the child first permits an explicit parent repair"
          ],
          "repair": "Resolve the dependent row according to business rules, then delete or retain the parent; changing RESTRICT to another action is a schema decision, not an error fix.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "23502",
      "condition_name": "not_null_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "not_null_insert",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "The target column is declared NOT NULL",
            "The insert supplies a NULL value"
          ],
          "trigger": "Insert a row with NULL in the NOT NULL column.",
          "assertions": [
            "SQLSTATE is 23502",
            "The column and relation are identified",
            "A valid row can be inserted after the error"
          ],
          "repair": "Provide a valid value or change the schema only after confirming the data contract; do not silently coerce a missing value without business meaning.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "23503",
      "condition_name": "foreign_key_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "fk_insert_missing_parent",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A parent table and a child table with a NOT DEFERRABLE foreign key",
            "The referenced key is absent"
          ],
          "trigger": "Insert a child row whose parent key does not exist.",
          "assertions": [
            "SQLSTATE is 23503",
            "The foreign-key constraint and child table are identified",
            "A valid parent and child row can be committed after rollback"
          ],
          "repair": "Create or select the intended parent before inserting the child; do not disable the constraint to hide the data error.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "23505",
      "condition_name": "unique_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true,
          "reason_if_unavailable": "The PG10 compatibility target is an isolated Docker container; an unavailable local Docker runtime is reported as not_run and cannot close the compatibility gate."
        }
      },
      "cases": [
        {
          "id": "dml_unique_conflict",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A disposable database or schema",
            "One NOT DEFERRABLE unique constraint"
          ],
          "trigger": "Insert a second row with the same email value.",
          "assertions": [
            "SQLSTATE is 23505",
            "Protocol diagnostics identify the schema, table, and constraint",
            "A successful autocommit connection is IDLE after the error"
          ],
          "repair": "Choose a valid key or change the business operation; do not discard the collision implicitly.",
          "cleanup": "Drop the case schema with an owner connection."
        },
        {
          "id": "explicit_tx_abort_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "An explicit transaction",
            "One unique constraint"
          ],
          "trigger": "Cause 23505 after BEGIN, then issue a statement before rollback.",
          "assertions": [
            "The failed transaction is INERROR",
            "The next statement gets 25P02",
            "ROLLBACK restores a usable connection"
          ],
          "repair": "ROLLBACK the transaction, then retry a deliberate valid operation.",
          "cleanup": "Drop the case schema with an owner connection."
        },
        {
          "id": "savepoint_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "An explicit transaction and SAVEPOINT",
            "One unique constraint"
          ],
          "trigger": "Cause 23505 after a savepoint while an outer change is pending.",
          "assertions": [
            "The failed subtransaction is INERROR",
            "ROLLBACK TO SAVEPOINT restores INTRANS",
            "The outer change and post-savepoint repair both commit"
          ],
          "repair": "ROLLBACK TO the savepoint and continue with a valid operation.",
          "cleanup": "Drop the case schema with an owner connection."
        },
        {
          "id": "deferred_commit_conflict",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A DEFERRABLE INITIALLY DEFERRED unique constraint",
            "Two duplicate rows in one transaction"
          ],
          "trigger": "Insert both rows successfully and commit.",
          "assertions": [
            "The inserts are accepted before COMMIT",
            "COMMIT raises 23505",
            "The failed top-level transaction returns to IDLE and its rows are rolled back"
          ],
          "repair": "Make keys unique before COMMIT or roll back and retry the whole transaction.",
          "cleanup": "Drop the case schema with an owner connection."
        },
        {
          "id": "plpgsql_exception_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "PL/pgSQL language",
            "A function that catches unique_violation"
          ],
          "trigger": "A natural duplicate insert inside the function.",
          "assertions": [
            "GET STACKED DIAGNOSTICS reports 23505",
            "The surrounding call succeeds",
            "The handler's repair row commits"
          ],
          "repair": "Use a narrowly scoped EXCEPTION handler and verify which statement caused the violation.",
          "cleanup": "Drop the function and case schema with an owner connection."
        },
        {
          "id": "concurrent_unique_conflict",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "Two sessions",
            "A unique index",
            "An observer session reading pg_stat_activity"
          ],
          "trigger": "Session A holds an uncommitted key while session B inserts the same key.",
          "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"
          ],
          "repair": "Coordinate key allocation or retry the complete transaction when the business operation is retryable.",
          "cleanup": "Roll back both workers if needed, then drop the case schema."
        },
        {
          "id": "on_conflict_target_scope",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "Separate unique email and phone constraints",
            "A pre-existing phone value"
          ],
          "trigger": "Use ON CONFLICT (email) for a row that collides only on phone.",
          "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"
          ],
          "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.",
          "cleanup": "Drop the case schema with an owner connection."
        },
        {
          "id": "nulls_not_distinct",
          "versions": [
            "15",
            "16",
            "17",
            "18"
          ],
          "preconditions": [
            "PostgreSQL 15 or later",
            "UNIQUE NULLS NOT DISTINCT is explicitly declared"
          ],
          "trigger": "Insert a second NULL into the explicit NULLS NOT DISTINCT constraint.",
          "assertions": [
            "The second NULL raises 23505",
            "The diagnostic identifies the explicit constraint",
            "The behavior is not attributed to an upgrade changing the old default"
          ],
          "repair": "Choose NULLS DISTINCT (the default) or NULLS NOT DISTINCT deliberately for the invariant.",
          "cleanup": "Drop the case schema with an owner connection."
        },
        {
          "id": "nulls_not_distinct_version_boundary",
          "versions": [
            "14",
            "15"
          ],
          "preconditions": [
            "A disposable PostgreSQL 14 or 15 target",
            "One ordinary UNIQUE and one explicit UNIQUE NULLS NOT DISTINCT declaration"
          ],
          "trigger": "Insert two NULLs under ordinary UNIQUE, then execute the explicit NULLS NOT DISTINCT declaration and, where supported, a second NULL.",
          "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"
          ],
          "repair": "Use the explicit NULL policy deliberately; after the supported duplicate, insert a valid non-duplicate value and verify the connection remains usable.",
          "cleanup": "Drop the case schema with an owner connection."
        },
        {
          "id": "sequence_lag_repair",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A controlled, quiesced case schema",
            "A sequence with START 100 and INCREMENT 7"
          ],
          "trigger": "Insert an explicit key equal to the sequence's first value, then call nextval.",
          "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"
          ],
          "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.",
          "cleanup": "Drop the case schema with an owner connection."
        },
        {
          "id": "index_build_conflict",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "Duplicate table rows",
            "Owner connection for index cleanup"
          ],
          "trigger": "Build a regular unique index and then a concurrent unique index over duplicate rows.",
          "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"
          ],
          "repair": "Resolve duplicates, drop an invalid concurrent index when present, and retry the appropriate build.",
          "cleanup": "Drop any leftover indexes and the case schema with an owner connection."
        },
        {
          "id": "diagnostic_visibility",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A restricted login role with INSERT but no SELECT privilege",
            "A seeded unique row"
          ],
          "trigger": "The restricted role inserts a duplicate key.",
          "assertions": [
            "SQLSTATE and protocol object fields remain available",
            "The key detail can be omitted when the role cannot inspect the key columns"
          ],
          "repair": "Use permitted diagnostics and server logs; do not assume detail is always present.",
          "cleanup": "Drop the role, table, and schema with an owner connection."
        },
        {
          "id": "log_fields",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A dedicated cluster with logging_collector and csvlog; jsonlog when supported"
          ],
          "trigger": "Cause a duplicate-key error and read the collector output.",
          "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"
          ],
          "repair": "Correlate logs with SQLSTATE and message fields; obtain object identity from the ErrorResponse or structured server context where available.",
          "cleanup": "Stop and remove only the runner-owned cluster or container."
        }
      ]
    },
    {
      "sqlstate": "23514",
      "condition_name": "check_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "check_constraint_insert",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "The target table has a named CHECK constraint",
            "The inserted value fails that predicate"
          ],
          "trigger": "Insert a row whose value violates the CHECK expression.",
          "assertions": [
            "SQLSTATE is 23514",
            "The named relation and constraint are identified",
            "A valid row can be inserted after the error"
          ],
          "repair": "Correct the value or deliberately revise the constraint after reviewing existing data; do not disable validation to hide a contract violation.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "23P01",
      "condition_name": "exclusion_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "overlapping_range_exclusion",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A range column has a GiST exclusion constraint using &&",
            "The second range overlaps the committed first range"
          ],
          "trigger": "Insert an overlapping range.",
          "assertions": [
            "SQLSTATE is 23P01",
            "The exclusion constraint is identified",
            "A non-overlapping range can be inserted afterward"
          ],
          "repair": "Choose a non-overlapping interval or resolve the conflicting reservation according to business rules; do not treat exclusion as a generic duplicate-key check.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "24000",
      "condition_name": "invalid_cursor_state",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "current_of_before_fetch",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A cursor is declared for a SELECT ... FOR UPDATE",
            "The cursor has not fetched a row"
          ],
          "trigger": "Use WHERE CURRENT OF before the cursor is positioned on a row.",
          "assertions": [
            "SQLSTATE is 24000",
            "The connection recovers after rollback",
            "A direct update succeeds afterward"
          ],
          "repair": "Fetch or otherwise position the cursor before CURRENT OF, or use a key-based update whose concurrency semantics are explicit.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25001",
      "condition_name": "active_sql_transaction",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "vacuum_inside_transaction",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A disposable table exists",
            "VACUUM is issued after an explicit BEGIN"
          ],
          "trigger": "Run VACUUM inside an explicit transaction block.",
          "assertions": [
            "SQLSTATE is 25001",
            "The transaction enters INERROR and rollback restores IDLE",
            "The same connection can execute a follow-up query",
            "VACUUM succeeds after rollback outside the transaction block"
          ],
          "repair": "Run transaction-control-restricted utility commands outside the transaction block; rollback the failed transaction before reuse.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25003",
      "condition_name": "inappropriate_access_mode_for_branch_transaction",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "branch_transaction_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Source/definition evidence only; no natural SQL trigger is claimed.",
          "assertions": [
            "No fabricated SQL trigger is included; the selected run records a definition/source boundary."
          ],
          "repair": "Follow the explicit transaction or source boundary described by the case.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25004",
      "condition_name": "inappropriate_isolation_level_for_branch_transaction",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "branch_transaction_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Source/definition evidence only; no natural SQL trigger is claimed.",
          "assertions": [
            "No fabricated SQL trigger is included; the selected run records a definition/source boundary."
          ],
          "repair": "Follow the explicit transaction or source boundary described by the case.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25005",
      "condition_name": "no_active_sql_transaction_for_branch_transaction",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "branch_transaction_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Source/definition evidence only; no natural SQL trigger is claimed.",
          "assertions": [
            "No fabricated SQL trigger is included; the selected run records a definition/source boundary."
          ],
          "repair": "Follow the explicit transaction or source boundary described by the case.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25006",
      "condition_name": "read_only_sql_transaction",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "read_only_transaction",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Run CREATE TABLE after SET TRANSACTION READ ONLY.",
          "assertions": [
            "SQLSTATE is 25006",
            "The CREATE TABLE read-only diagnostic is exact",
            "The failed transaction is INERROR, ROLLBACK restores IDLE",
            "The table can be created after leaving read-only mode"
          ],
          "repair": "Follow the explicit transaction or source boundary described by the case.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25007",
      "condition_name": "schema_and_data_statement_mixing_not_supported",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "schema_data_statement_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Source/definition evidence only; no natural SQL trigger is claimed.",
          "assertions": [
            "No fabricated SQL trigger is included; the selected run records a definition/source boundary."
          ],
          "repair": "Follow the explicit transaction or source boundary described by the case.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25008",
      "condition_name": "held_cursor_requires_same_isolation_level",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "held_cursor_isolation_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Source/definition evidence only; no natural SQL trigger is claimed.",
          "assertions": [
            "No fabricated SQL trigger is included; the selected run records a definition/source boundary."
          ],
          "repair": "Follow the explicit transaction or source boundary described by the case.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25P01",
      "condition_name": "no_active_sql_transaction",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "savepoint_without_transaction",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Run SAVEPOINT without BEGIN, then repeat inside an explicit block.",
          "assertions": [
            "SQLSTATE is 25P01",
            "SAVEPOINT outside a block reports the no-active-transaction message",
            "An explicit BEGIN/SAVEPOINT/RELEASE/COMMIT repair succeeds"
          ],
          "repair": "Follow the explicit transaction or source boundary described by the case.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25P02",
      "condition_name": "in_failed_sql_transaction",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "failed_transaction_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Raise a root unique violation, then issue a query before ROLLBACK.",
          "assertions": [
            "The root duplicate is 23505",
            "The follow-up command reports 25P02",
            "The failed transaction remains INERROR until ROLLBACK",
            "A new explicit transaction commits the repaired row"
          ],
          "repair": "Follow the explicit transaction or source boundary described by the case.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25P03",
      "condition_name": "idle_in_transaction_session_timeout",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "idle_in_transaction_timeout",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Set idle_in_transaction_session_timeout, BEGIN, wait idle, and probe the terminated session.",
          "assertions": [
            "The original session is terminated by the timeout",
            "The collector records FATAL 25P03 for the matching backend PID",
            "A fresh connection can execute SELECT 1"
          ],
          "repair": "Use the state-specific recovery documented on the page; do not reuse a terminated connection.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "25P04",
      "condition_name": "transaction_timeout",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": false
        }
      },
      "cases": [
        {
          "id": "transaction_timeout",
          "versions": [
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "On a server supporting transaction_timeout, set it, BEGIN, wait, and probe the terminated session.",
          "assertions": [
            "The original session is terminated by the timeout when supported",
            "The collector records FATAL 25P04 for the matching backend PID",
            "A fresh connection can execute SELECT 1",
            "PG10 is explicitly not applicable"
          ],
          "repair": "Use the state-specific recovery documented on the page; do not reuse a terminated connection.",
          "cleanup": "Drop the case schema with an owner connection."
        },
        {
          "id": "transaction_timeout_version_boundary",
          "versions": [
            "16",
            "17"
          ],
          "preconditions": [
            "A disposable PostgreSQL 16 or 17 target"
          ],
          "trigger": "Probe transaction_timeout on PG16; on PG17 set it, BEGIN, wait, and probe the terminated session.",
          "assertions": [
            "PG16 records the actual unsupported-setting diagnostic and recovers",
            "PG17 records exact FATAL 25P04 collector fields and a registry-based fresh connection probe"
          ],
          "repair": "Treat PG16 as unsupported for this setting; for PG17 use a fresh connection after the FATAL and determine unfinished work from the application transaction boundary.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "26000",
      "condition_name": "invalid_sql_statement_name",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "prepared_statement_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Prepare a named statement, deallocate it, then execute the missing name on the same session.",
          "assertions": [
            "SQLSTATE is 26000",
            "The prepared statement name is in the diagnostic",
            "The same session can recreate and execute the statement after the error"
          ],
          "repair": "Recreate the prepared statement on the session that will execute it; prepared statements are session-local.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "27000",
      "condition_name": "triggered_data_change_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "triggered_data_change_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "No artificial trigger is executed; the page records the fixed source path and its safe-case boundary.",
          "assertions": [],
          "repair": "Use the source-confirmed trigger design and test it separately when the application can control the affected-row semantics.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "28000",
      "condition_name": "invalid_authorization_specification",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_authorization",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Attempt startup as a generated role that does not exist, then probe a known owner connection.",
          "assertions": [
            "The selected server diagnostic has the expected SQLSTATE",
            "The selected recovery/probe assertions pass",
            "Runner-owned resources are cleaned up"
          ],
          "repair": "Follow the case-specific repair statements and verify the resulting state.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "28P01",
      "condition_name": "invalid_password",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "wrong_password_authentication",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A disposable login role with a known password",
            "A temporary first pg_hba.conf rule uses md5 and is reloaded"
          ],
          "trigger": "Connect with a wrong password and retain the server's authentication diagnostic.",
          "assertions": [
            "The connection attempt receives SQLSTATE 28P01",
            "The server does not open a transaction for the rejected connection",
            "The known password opens a new session while the temporary rule is active",
            "A fresh management connection succeeds after the original configuration is restored"
          ],
          "repair": "Use the intended secret and authentication method, verify a new connection, then restore or rotate credentials without logging passwords.",
          "cleanup": "Restore pg_hba.conf and drop the role and schema."
        }
      ]
    },
    {
      "sqlstate": "2B000",
      "condition_name": "dependent_privilege_descriptors_still_exist",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "dependent_privilege_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "No artificial privilege-revocation case is executed.",
          "assertions": [],
          "repair": "Inspect dependent privileges and choose an explicit revoke/ownership operation; do not relabel a dependent-object DROP as 2B000.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "2BP01",
      "condition_name": "dependent_objects_still_exist",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "dependent_object_drop_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Create a view that depends on a table, attempt DROP TABLE inside an explicit transaction, then drop the view first and the table.",
          "assertions": [
            "SQLSTATE is 2BP01",
            "The diagnostic names dependent objects",
            "The failed transaction is INERROR until ROLLBACK",
            "Dropping the dependent view first removes both objects without CASCADE"
          ],
          "repair": "Rollback the failed DROP, inspect the named dependent objects, and remove them in an intentional dependency order.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "2D000",
      "condition_name": "invalid_transaction_termination",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_transaction_termination_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "No generic SQL-only transaction-termination case is executed; the fixed SPI procedure/subtransaction guard is recorded as a source boundary.",
          "assertions": [],
          "repair": "Keep transaction control at the procedure boundary supported by the server; do not add COMMIT/ROLLBACK inside a context that forbids termination.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "34000",
      "condition_name": "invalid_cursor_name",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "cursor_lifecycle_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Declare and close a named cursor, attempt to use it again, then recreate it in a new explicit transaction on the same session.",
          "assertions": [
            "SQLSTATE is 34000",
            "The missing cursor diagnostic is preserved",
            "The failed block recovers through ROLLBACK",
            "A recreated cursor can FETCH and COMMIT"
          ],
          "repair": "Keep cursor use on the declaring backend session and respect its transaction lifetime; after an error, roll back before recreating it.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "3B000",
      "condition_name": "savepoint_exception",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "savepoint_exception_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "No generic 3B000 trigger is executed; the specific invalid-savepoint path is covered by 3B001.",
          "assertions": [],
          "repair": "Use the specific savepoint condition and transaction boundary supplied by the server; do not manufacture a class-level RAISE.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "3B001",
      "condition_name": "invalid_savepoint_specification",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_savepoint_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Inside a valid explicit transaction, roll back to a savepoint name that was never established, then rollback and establish a valid savepoint.",
          "assertions": [
            "SQLSTATE is 3B001",
            "The diagnostic identifies the missing savepoint",
            "The failed block is INERROR until ROLLBACK",
            "A valid SAVEPOINT/RELEASE/COMMIT succeeds afterward"
          ],
          "repair": "Verify the savepoint name and nesting level; rollback the failed block before issuing a new savepoint sequence.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "3D000",
      "condition_name": "invalid_catalog_name",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_database",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Attempt startup against a generated database name that does not exist.",
          "assertions": [
            "The selected server diagnostic has the expected SQLSTATE",
            "The selected recovery/probe assertions pass",
            "Runner-owned resources are cleaned up"
          ],
          "repair": "Follow the case-specific repair statements and verify the resulting state.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "3F000",
      "condition_name": "invalid_schema_name",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_schema_name",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Use a missing schema-qualified table, create the schema explicitly, and verify one repaired row.",
          "assertions": [
            "The selected server diagnostic has the expected SQLSTATE",
            "The selected recovery/probe assertions pass",
            "Runner-owned resources are cleaned up"
          ],
          "repair": "Follow the case-specific repair statements and verify the resulting state.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "40000",
      "condition_name": "transaction_rollback",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "transaction_rollback_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "No internal system-catalog-scan fault is injected; the fixed source path remains a source-only boundary.",
          "assertions": [],
          "repair": "Treat this umbrella as a transaction rollback outcome only after identifying the concrete source mechanism; do not retry an unknown internal failure blindly.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "40001",
      "condition_name": "serialization_failure",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "serializable_stale_update",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "Two sessions using SERIALIZABLE",
            "Both read the same row before either writes"
          ],
          "trigger": "Commit one writer, then update the row from the stale serializable transaction.",
          "assertions": [
            "The stale writer receives 40001",
            "Its transaction is rolled back",
            "The first committed value remains before retry",
            "A fresh serializable snapshot is read, applied, and committed as a complete retry"
          ],
          "repair": "Retry the complete serializable transaction with bounded backoff and an idempotency policy; begin from a fresh snapshot and verify the final business result.",
          "cleanup": "Roll back workers and drop the case schema."
        }
      ]
    },
    {
      "sqlstate": "40002",
      "condition_name": "transaction_integrity_constraint_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "transaction_integrity_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "No natural core 40002 path was resolved in the fixed scan, so no SQL trigger is fabricated.",
          "assertions": [],
          "repair": "Use the concrete SQLSTATE emitted by the actual operation and reconcile the transaction outcome before retrying.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "40003",
      "condition_name": "statement_completion_unknown",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "statement_completion_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "No connection-loss or uncertain-completion success claim is fabricated.",
          "assertions": [],
          "repair": "When completion is uncertain, reconcile durable business state before retrying; this page does not claim a SQL-only reproduction.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "40P01",
      "condition_name": "deadlock_detected",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "two_session_lock_cycle",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "Two sessions",
            "Two rows",
            "Both sessions acquire one row lock before attempting the other"
          ],
          "trigger": "Each session requests the row held by the other, using a barrier and observed lock waits.",
          "assertions": [
            "One statement receives 40P01",
            "The victim transaction is rolled back",
            "The surviving session can finish with one coherent update per row",
            "A post-victim retry takes locks in order and commits the complete repair"
          ],
          "repair": "Keep lock order consistent; after rollback, retry the complete idempotent transaction in that order and verify its committed result.",
          "cleanup": "Roll back workers and drop the case schema."
        }
      ]
    },
    {
      "sqlstate": "42000",
      "condition_name": "syntax_error_or_access_rule_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "syntax_access_rule_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A fixed source scan is available."
          ],
          "trigger": "No artificial generic 42000 trigger is executed; concrete child paths are covered separately.",
          "assertions": [],
          "repair": "Use the concrete child SQLSTATE and repair the syntax or access rule it identifies.",
          "cleanup": "No database case resources are created."
        }
      ]
    },
    {
      "sqlstate": "42501",
      "condition_name": "insufficient_privilege",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "permission_denied_sequence",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned.",
            "The runner can create a login role and grant schema/table privileges."
          ],
          "trigger": "Create a sequence, grant schema usage but no sequence privilege, then call nextval as a separate role.",
          "assertions": [
            "SQLSTATE is 42501 with sequence privilege diagnostic",
            "The denied role session remains IDLE",
            "Granting sequence USAGE permits nextval and returns the first value"
          ],
          "repair": "Grant only the required sequence privilege or change the owning role policy, then retry nextval on the same role session.",
          "cleanup": "Drop the case schema and temporary role with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "42601",
      "condition_name": "syntax_error",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "syntax_limit_comma",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned with a deterministic three-row ordered query."
          ],
          "trigger": "Execute the unsupported comma form over ordered rows: SELECT n FROM generate_series(1, 3) AS s(n) ORDER BY n LIMIT 1, 2.",
          "assertions": [
            "SQLSTATE is 42601 with the LIMIT #,# diagnostic",
            "The autocommit session remains IDLE",
            "Separate LIMIT and OFFSET syntax returns the second and third rows [2, 3]"
          ],
          "repair": "Use separate LIMIT and OFFSET clauses as indicated by the server hint.",
          "cleanup": "No persistent objects; close the runner connection."
        }
      ]
    },
    {
      "sqlstate": "42602",
      "condition_name": "invalid_name",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "invalid_enum_label",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Create an enum and add a 64-byte label, exceeding the enum label limit.",
          "assertions": [
            "SQLSTATE is 42602 and the primary identifies an invalid enum label",
            "The session remains IDLE",
            "Adding a short label succeeds and the enum contains both labels"
          ],
          "repair": "Use an enum label within the server byte limit or model longer values as data.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "42611",
      "condition_name": "invalid_column_definition",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "conflicting_inherited_default",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Create two parent tables with different defaults and inherit both without an explicit child default.",
          "assertions": [
            "SQLSTATE is 42611 with the conflicting-default diagnostic",
            "The session remains IDLE",
            "An explicit child default resolves the inheritance conflict and DEFAULT inserts 1"
          ],
          "repair": "Specify the intended default explicitly on the child definition, then verify the inherited table.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "42622",
      "condition_name": "name_too_long",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "identifier_too_long_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "The fixed REL_18_6 and REL_10_23 source paths are available."
          ],
          "trigger": "No ordinary SQL cast is claimed: fixed source shows 42622 in binary name receive, while text casts truncate identifiers before that path.",
          "assertions": [],
          "repair": "Use a protocol path that validates the name value before retrying, or keep long user text outside the name type.",
          "cleanup": "No persistent objects; close the runner connection."
        }
      ]
    },
    {
      "sqlstate": "42701",
      "condition_name": "duplicate_column",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "duplicate_column",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Create a table that lists id twice.",
          "assertions": [
            "SQLSTATE is 42701 with the duplicate-column diagnostic",
            "The session remains IDLE",
            "A table with distinct columns can be created and inspected"
          ],
          "repair": "Give each column a distinct name and rerun the DDL.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "42702",
      "condition_name": "ambiguous_column",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "ambiguous_column",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Join two tables that both expose id and select id without qualification.",
          "assertions": [
            "SQLSTATE is 42702 with the ambiguous-reference diagnostic",
            "The session remains IDLE",
            "Qualifying the column returns the intended row"
          ],
          "repair": "Qualify the column with its table or alias and verify the intended source.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "42703",
      "condition_name": "undefined_column",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "undefined_column",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Select a column name that is absent from a real table.",
          "assertions": [
            "SQLSTATE is 42703 with the undefined-column diagnostic",
            "The session remains IDLE",
            "Selecting the defined id column succeeds"
          ],
          "repair": "Correct the column name or migration, then rerun the query against the intended relation.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "42704",
      "condition_name": "undefined_object",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "missing_trigger",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned.",
            "PL/pgSQL is available for the repair trigger function."
          ],
          "trigger": "Drop a named trigger that does not exist on a real table.",
          "assertions": [
            "SQLSTATE is 42704 with a missing-trigger diagnostic",
            "The session remains IDLE",
            "Creating and dropping a real trigger completes the repair lifecycle"
          ],
          "repair": "Inspect the relation and trigger name; create or drop the intended trigger explicitly rather than changing unrelated objects.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "42710",
      "condition_name": "duplicate_object",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "duplicate_object_type",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Create the same ENUM type name twice in the runner schema.",
          "assertions": [
            "SQLSTATE is 42710 with the duplicate type message and its naming hint",
            "The failed autocommit session remains IDLE",
            "Creating a nonconflicting type and inspecting pg_type succeeds"
          ],
          "repair": "Use a distinct type name after confirming the existing type; do not drop an unknown owner's object.",
          "cleanup": "Drop the runner schema and all types it owns."
        }
      ]
    },
    {
      "sqlstate": "42712",
      "condition_name": "duplicate_alias",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "duplicate_table_alias",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Use the same table alias for two VALUES relations in one SELECT.",
          "assertions": [
            "SQLSTATE is 42712 with the duplicate table-name message",
            "The failed autocommit session remains IDLE",
            "Distinct aliases return the two input values"
          ],
          "repair": "Give each range-table entry a distinct alias; do not rename unrelated catalog objects.",
          "cleanup": "Close the runner connection; no persistent objects are created."
        }
      ]
    },
    {
      "sqlstate": "42723",
      "condition_name": "duplicate_function",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "duplicate_function_signature",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Create a function and repeat the same name and integer argument signature.",
          "assertions": [
            "SQLSTATE is 42723 with the same-argument-types message",
            "The failed autocommit session remains IDLE",
            "CREATE OR REPLACE with the intentional same signature returns the repaired value"
          ],
          "repair": "Choose a new signature or use CREATE OR REPLACE only when replacing the owned function is intentional.",
          "cleanup": "Drop the runner schema and its functions."
        }
      ]
    },
    {
      "sqlstate": "42725",
      "condition_name": "ambiguous_function",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "ambiguous_function_call",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Call two uuid/jsonb overloads with an unknown string literal.",
          "assertions": [
            "SQLSTATE is 42725 and the diagnostic identifies ambiguous_function(unknown)",
            "The hint requests explicit type casts and the session remains IDLE",
            "An explicit uuid cast selects the intended overload"
          ],
          "repair": "Cast the input to the intended type or remove the overload ambiguity; do not guess from a function name alone.",
          "cleanup": "Drop the runner schema and its overloads."
        }
      ]
    },
    {
      "sqlstate": "42803",
      "condition_name": "grouping_error",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "grouping_non_grouped_column",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Select a nonaggregate label while grouping only the category column.",
          "assertions": [
            "SQLSTATE is 42803 and the diagnostic identifies the ungrouped label",
            "The failed autocommit session remains IDLE",
            "Grouping both selected nonaggregate columns returns two deterministic rows"
          ],
          "repair": "Decide whether the label should be grouped or aggregated; adding GROUP BY blindly can change the intended cardinality.",
          "cleanup": "Close the runner connection; the case uses VALUES only."
        }
      ]
    },
    {
      "sqlstate": "42804",
      "condition_name": "datatype_mismatch",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "default_type_mismatch",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Define an integer column whose default expression is explicitly text.",
          "assertions": [
            "SQLSTATE is 42804 with the type mismatch and rewrite/cast hint",
            "The failed autocommit session remains IDLE",
            "A matching integer default can be inserted and read back"
          ],
          "repair": "Make the expression type match the column or add a deliberate, valid cast; input-value errors such as 22P02 are a different path.",
          "cleanup": "Drop the runner schema and its table."
        }
      ]
    },
    {
      "sqlstate": "42809",
      "condition_name": "wrong_object_type",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "view_row_trigger_type",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Create a row-level BEFORE trigger on a view.",
          "assertions": [
            "SQLSTATE is 42809 with the view object type and row-trigger detail",
            "The failed autocommit session remains IDLE",
            "An INSTEAD OF trigger is accepted on the view"
          ],
          "repair": "Use the trigger kind allowed for the object; a view is not a table and its INSTEAD OF rules do not authorize row-level BEFORE/AFTER triggers.",
          "cleanup": "Drop the runner schema, view, function, and trigger."
        }
      ]
    },
    {
      "sqlstate": "42830",
      "condition_name": "invalid_foreign_key",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "fk_missing_unique_key",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Create a foreign key referencing a parent column with no unique constraint.",
          "assertions": [
            "SQLSTATE is 42830 with the missing referenced unique-key message",
            "The failed autocommit session remains IDLE",
            "Adding a parent UNIQUE constraint then the FK creates one valid constraint"
          ],
          "repair": "Add a deliberate primary/unique key over the referenced columns before defining the FK; matching types alone are insufficient.",
          "cleanup": "Drop the runner schema and both tables."
        }
      ]
    },
    {
      "sqlstate": "42846",
      "condition_name": "cannot_coerce",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "impossible_cast",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Explicitly cast an integer expression to date.",
          "assertions": [
            "SQLSTATE is 42846 with cannot cast type integer to date",
            "The failed autocommit session remains IDLE",
            "A date-typed literal returns the intended date"
          ],
          "repair": "Use a source type with a documented cast or construct a value in the target type; changing an input string is not the same as making an impossible type cast valid.",
          "cleanup": "Close the runner connection; no persistent objects are created."
        }
      ]
    },
    {
      "sqlstate": "42883",
      "condition_name": "undefined_function",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "missing_function_resolution",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Call a schema-qualified function with an integer argument before that signature exists.",
          "assertions": [
            "SQLSTATE is 42883 and the diagnostic names the missing function signature",
            "The failed autocommit session remains IDLE",
            "Creating the exact integer signature then returns 42"
          ],
          "repair": "Check schema visibility, function/operator name, argument types, and overload resolution; create or call the intended signature rather than blindly changing search_path.",
          "cleanup": "Drop the runner schema and its function."
        }
      ]
    },
    {
      "sqlstate": "42P01",
      "condition_name": "undefined_table",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "missing_relation",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A disposable schema name that has no relation"
          ],
          "trigger": "Select from a relation that does not exist.",
          "assertions": [
            "SQLSTATE is 42P01",
            "The missing relation is named in the diagnostic",
            "A valid query succeeds after correcting the relation name"
          ],
          "repair": "Check schema qualification, search_path, migrations, and case-sensitive quoting before creating or renaming objects.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "44000",
      "condition_name": "with_check_option_violation",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "view_check_option_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned."
          ],
          "trigger": "Insert a row through a view with a visible-row predicate and WITH CHECK OPTION, then insert a row satisfying the predicate.",
          "assertions": [
            "SQLSTATE is 44000",
            "The diagnostic identifies the view",
            "The rejected row leaves autocommit usable",
            "A row satisfying the view predicate is accepted"
          ],
          "repair": "Fix the row or the view predicate deliberately; do not bypass the view invariant by treating this as a table constraint failure.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "53300",
      "condition_name": "too_many_connections",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "role_connection_limit",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A disposable login role",
            "The role connection limit is set to one while one session is already connected"
          ],
          "trigger": "Open a second connection for that role.",
          "assertions": [
            "The new connection receives FATAL SQLSTATE 53300",
            "The existing owner connection can restore the limit and continue"
          ],
          "repair": "Pool and bound connections, reserve capacity for administration, and investigate the role/database/server limit that was reached.",
          "cleanup": "Restore the role limit, drop the role, and drop the case schema."
        }
      ]
    },
    {
      "sqlstate": "55000",
      "condition_name": "object_not_in_prerequisite_state",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "currval_before_nextval",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned sequence exists.",
            "The trigger and repair use one backend session."
          ],
          "trigger": "Call currval for a sequence before this backend has called nextval, then initialize and read it.",
          "assertions": [
            "SQLSTATE is 55000 with ERROR severity",
            "The diagnostic says currval is not yet defined in this session",
            "The failed autocommit session remains IDLE",
            "nextval initializes currval on the same backend and both values are 10"
          ],
          "repair": "Use nextval in the same session before currval, or pass an explicitly known value; creating the sequence in another session does not initialize this session’s currval state.",
          "cleanup": "Close all runner connections and drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "55006",
      "condition_name": "object_in_use",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "active_cursor_drop",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned empty table exists; a cursor can still hold the relation in active use.",
            "The table cursor and DROP run on one backend session."
          ],
          "trigger": "Declare and use a cursor on a table in an explicit transaction, then attempt to DROP that table from the same session.",
          "assertions": [
            "SQLSTATE is 55006 with ERROR severity",
            "The diagnostic says the table is used by active queries in this session",
            "The failed DROP leaves the explicit transaction INERROR",
            "ROLLBACK releases the transaction-owned cursor and the same session can DROP the table"
          ],
          "repair": "Rollback the failed transaction to release its cursor and then repeat the DDL; do not hide an active-session dependency with CASCADE.",
          "cleanup": "Close all runner connections and drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "55P03",
      "condition_name": "lock_not_available",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "nowait_row_lock",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "Two runner-owned sessions target one row.",
            "The blocker acquires its lock before the NOWAIT statement is sent."
          ],
          "trigger": "Hold a row lock in one explicit transaction, issue SELECT FOR UPDATE NOWAIT from a second session, then release and retry.",
          "assertions": [
            "SQLSTATE is 55P03 with ERROR severity",
            "The diagnostic identifies a row lock that cannot be obtained immediately",
            "The blocker is INTRANS and the NOWAIT contender remains IDLE after its error",
            "After blocker rollback the same contender updates and reads the row"
          ],
          "repair": "Use a bounded NOWAIT failure as a signal, release or resolve the blocker, then retry according to the application’s lock policy; this case does not treat sleeping as synchronization.",
          "cleanup": "Close all runner connections and drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "57014",
      "condition_name": "query_canceled",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "statement_timeout_cancel",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A dedicated connection",
            "statement_timeout set to 100 ms"
          ],
          "trigger": "Run pg_sleep(1) and let the server cancel the statement at the configured timeout.",
          "assertions": [
            "SQLSTATE is 57014",
            "The message identifies statement timeout",
            "The autocommit connection is usable for a subsequent query"
          ],
          "repair": "Classify timeout by operation and budget; tune the timeout or query, and do not treat cancellation as proof that all server work has stopped without checking the operation.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "57P01",
      "condition_name": "admin_shutdown",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "admin_terminate_backend",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A runner-owned disposable target is provisioned.",
            "The victim PID is obtained from the connection being terminated."
          ],
          "trigger": "Create a runner client session, terminate only its backend PID from a separate runner session, and reconnect.",
          "assertions": [
            "The terminated backend reports SQLSTATE 57P01 and FATAL administrator-command text",
            "The selected PID is verified as a runner-created client backend and differs from the admin PID",
            "The victim connection closes after termination",
            "A fresh runner connection executes SELECT 1 successfully"
          ],
          "repair": "Treat the old connection as unusable after administrator termination; inspect the operation outcome and establish a fresh connection before continuing.",
          "cleanup": "Close all runner connections and drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "P0001",
      "condition_name": "raise_exception",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "plpgsql_raise_exception",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "PL/pgSQL is available"
          ],
          "trigger": "Execute a function containing RAISE EXCEPTION without an explicit SQLSTATE.",
          "assertions": [
            "SQLSTATE is P0001",
            "The custom message is preserved",
            "The failed call is isolated to its transaction"
          ],
          "repair": "Use a domain-specific SQLSTATE only when the caller contract requires it; catch and handle the exception at the correct transaction boundary.",
          "cleanup": "Drop the function and case schema."
        }
      ]
    },
    {
      "sqlstate": "P0004",
      "condition_name": "assert_failure",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "assertion_failure_recovery",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A disposable runner target has PL/pgSQL available.",
            "plpgsql.check_asserts is explicitly enabled before the trigger."
          ],
          "trigger": "Call a PL/pgSQL function whose ASSERT condition is false inside an explicit transaction.",
          "assertions": [
            "The natural ASSERT failure has SQLSTATE P0004 and the expected diagnostic.",
            "The failed explicit transaction is INERROR and ROLLBACK returns it to IDLE.",
            "A valid call succeeds after rollback, and an explicit check_asserts=off control suppresses the assertion.",
            "Re-enabling check_asserts makes the valid call succeed and the runner cleans up."
          ],
          "repair": "Rollback the failed transaction, use a valid input, and keep assertions enabled for production behavior.",
          "cleanup": "Drop the case schema with an owner connection."
        }
      ]
    },
    {
      "sqlstate": "XX000",
      "condition_name": "internal_error",
      "runner": "scripts/verify_cases.py",
      "targets": {
        "latest": {
          "binary": "Homebrew PostgreSQL 18.6",
          "required": true
        },
        "pg10": {
          "image": "postgres:10",
          "required": true
        }
      },
      "cases": [
        {
          "id": "internal_error_safety_boundary",
          "versions": [
            "10",
            "18"
          ],
          "preconditions": [
            "A source-confirmed internal error path"
          ],
          "trigger": "No deterministic safe SQL trigger is used; forcing internal corruption would violate the disposable-case safety boundary.",
          "assertions": [
            "The directory and source paths are recorded",
            "The batch marks the natural runtime trigger not applicable rather than fabricating one"
          ],
          "repair": "Preserve diagnostics, stop treating the session as healthy when appropriate, and investigate the exact server path with supportable evidence.",
          "cleanup": "No runtime resources are created."
        }
      ]
    }
  ]
}
