{"id":"a76fe3c1646e9be8","repo":"jackc/pgx","slug":"numeric-incomplete-w","errorCode":null,"errorMessage":"numeric incomplete: %w","messagePattern":"numeric incomplete: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/numeric.go","lineNumber":637,"sourceCode":"}\n\ntype scanPlanBinaryNumericToNumericScanner struct{}\n\nfunc (scanPlanBinaryNumericToNumericScanner) Scan(src []byte, dst any) error {\n\tscanner := (dst).(NumericScanner)\n\n\tif src == nil {\n\t\treturn scanner.ScanNumeric(Numeric{})\n\t}\n\n\tr := pgio.NewReader(src)\n\n\tndigits := r.Uint16()\n\tweight := r.Int16()\n\tsign := r.Uint16()\n\tdscale := r.Int16()\n\tif err := r.Err(); err != nil {\n\t\treturn fmt.Errorf(\"numeric incomplete: %w\", err)\n\t}\n\n\tswitch sign {\n\tcase pgNumericNaNSign:\n\t\treturn scanner.ScanNumeric(Numeric{NaN: true, Valid: true})\n\tcase pgNumericPosInfSign:\n\t\treturn scanner.ScanNumeric(Numeric{InfinityModifier: Infinity, Valid: true})\n\tcase pgNumericNegInfSign:\n\t\treturn scanner.ScanNumeric(Numeric{InfinityModifier: NegativeInfinity, Valid: true})\n\t}\n\n\tif ndigits == 0 {\n\t\treturn scanner.ScanNumeric(Numeric{Int: big.NewInt(0), Valid: true})\n\t}\n\n\tif r.Remaining() < int(ndigits)*2 {\n\t\treturn fmt.Errorf(\"numeric incomplete %v\", src)\n\t}","sourceCodeStart":619,"sourceCodeEnd":655,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/numeric.go#L619-L655","documentation":"Error \"numeric incomplete: %w\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/numeric.go:637 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}