{"id":"c0d46a8090b3a21d","repo":"jackc/pgx","slug":"invalid-length-for-readyforquery-txstatus","errorCode":null,"errorMessage":"invalid length for ReadyForQuery.TxStatus","messagePattern":"invalid length for ReadyForQuery\\.TxStatus","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgproto3/ready_for_query.go","lineNumber":57,"sourceCode":"\t\tTxStatus: string(src.TxStatus),\n\t})\n}\n\n// UnmarshalJSON implements encoding/json.Unmarshaler.\nfunc (dst *ReadyForQuery) UnmarshalJSON(data []byte) error {\n\t// Ignore null, like in the main JSON package.\n\tif string(data) == \"null\" {\n\t\treturn nil\n\t}\n\n\tvar msg struct {\n\t\tTxStatus string\n\t}\n\tif err := json.Unmarshal(data, &msg); err != nil {\n\t\treturn err\n\t}\n\tif len(msg.TxStatus) != 1 {\n\t\treturn errors.New(\"invalid length for ReadyForQuery.TxStatus\")\n\t}\n\tdst.TxStatus = msg.TxStatus[0]\n\treturn nil\n}\n","sourceCodeStart":39,"sourceCodeEnd":62,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgproto3/ready_for_query.go#L39-L62","documentation":"Error \"invalid length for ReadyForQuery.TxStatus\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgproto3/ready_for_query.go:57 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}