{"record":{"id":"0d02290b3104a539","repo":"jackc/pgx","slug":"invalid-length-for-line-v","errorCode":null,"errorMessage":"invalid length for line: %v","messagePattern":"invalid length for line: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/line.go","lineNumber":183,"sourceCode":"\treturn scanner.ScanLine(Line{\n\t\tA:     math.Float64frombits(a),\n\t\tB:     math.Float64frombits(b),\n\t\tC:     math.Float64frombits(c),\n\t\tValid: true,\n\t})\n}\n\ntype scanPlanTextAnyToLineScanner struct{}\n\nfunc (scanPlanTextAnyToLineScanner) Scan(src []byte, dst any) error {\n\tscanner := (dst).(LineScanner)\n\n\tif src == nil {\n\t\treturn scanner.ScanLine(Line{})\n\t}\n\n\tif len(src) < 7 {\n\t\treturn fmt.Errorf(\"invalid length for line: %v\", len(src))\n\t}\n\n\tparts := strings.SplitN(string(src[1:len(src)-1]), \",\", 3)\n\tif len(parts) < 3 {\n\t\treturn fmt.Errorf(\"invalid format for line\")\n\t}\n\n\ta, err := strconv.ParseFloat(parts[0], 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tb, err := strconv.ParseFloat(parts[1], 64)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\tc, err := strconv.ParseFloat(parts[2], 64)","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/line.go#L165-L201","documentation":"The textual line representation '{A,B,C}' needs at least 7 bytes including braces and two separating commas. This length guard fires before parsing when the source is shorter than that minimum, so the value cannot possibly be a well-formed line string.","triggerScenarios":"Thrown at pgtype/line.go:183 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the stored value matches the '{a,b,c}' line text format","Correct any custom encoding that produced the short string","Use the binary format to avoid text parsing entirely"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}