{"record":{"id":"6d06e6a072dad79b","repo":"jackc/pgx","slug":"line-w","errorCode":null,"errorMessage":"line: %w","messagePattern":"line: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/line.go","lineNumber":162,"sourceCode":"}\n\ntype scanPlanBinaryLineToLineScanner struct{}\n\nfunc (scanPlanBinaryLineToLineScanner) 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\tr := pgio.NewReader(src)\n\n\ta := r.Uint64()\n\tb := r.Uint64()\n\tc := r.Uint64()\n\n\tif err := r.Finish(); err != nil {\n\t\treturn fmt.Errorf(\"line: %w\", err)\n\t}\n\n\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}","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/line.go#L144-L180","documentation":"After reading the three float64 coefficients (A, B, C) of a binary-encoded line, the plan requires that the 24-byte payload is fully consumed. This wrapper fires when pgio's reader reports leftover or insufficient bytes — the value's length did not exactly match the fixed line layout, indicating a truncated or malformed binary value.","triggerScenarios":"Thrown at pgtype/line.go:162 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the column is a PostgreSQL line type and the value wasn't truncated in transit","Check for bugs in custom binary encoding if the value was produced client-side","Use the text format for the column as a workaround"],"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"}