{"id":"79fc0a6966f4e08e","repo":"jackc/pgx","slug":"jsonb-too-short","errorCode":null,"errorMessage":"jsonb too short","messagePattern":"jsonb too short","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/jsonb.go","lineNumber":68,"sourceCode":"\t\t}\n\tcase TextFormatCode:\n\t\treturn (&JSONCodec{Marshal: c.Marshal, Unmarshal: c.Unmarshal}).PlanScan(m, oid, format, target)\n\t}\n\n\treturn nil\n}\n\ntype scanPlanJSONBCodecBinaryUnwrapper struct {\n\ttextPlan ScanPlan\n}\n\nfunc (plan *scanPlanJSONBCodecBinaryUnwrapper) Scan(src []byte, dst any) error {\n\tif src == nil {\n\t\treturn plan.textPlan.Scan(src, dst)\n\t}\n\n\tif len(src) == 0 {\n\t\treturn fmt.Errorf(\"jsonb too short\")\n\t}\n\n\tif src[0] != 1 {\n\t\treturn fmt.Errorf(\"unknown jsonb version number %d\", src[0])\n\t}\n\n\treturn plan.textPlan.Scan(src[1:], dst)\n}\n\nfunc (c *JSONBCodec) DecodeDatabaseSQLValue(m *Map, oid uint32, format int16, src []byte) (driver.Value, error) {\n\tif src == nil {\n\t\treturn nil, nil\n\t}\n\n\tswitch format {\n\tcase BinaryFormatCode:\n\t\tif len(src) == 0 {\n\t\t\treturn nil, fmt.Errorf(\"jsonb too short\")","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/jsonb.go#L50-L86","documentation":"Error \"jsonb too short\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/jsonb.go:68 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}