{"id":"bc08abb3a00cd708","repo":"jackc/pgx","slug":"s-is-not-a-number","errorCode":null,"errorMessage":"%s is not a number","messagePattern":"(.+?) is not a number","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/numeric.go","lineNumber":199,"sourceCode":"\treturn num, nil\n}\n\nfunc parseNumericString(str string) (n *big.Int, exp int32, err error) {\n\tidx := strings.IndexByte(str, '.')\n\n\tif idx == -1 {\n\t\tfor len(str) > 1 && str[len(str)-1] == '0' && str[len(str)-2] != '-' {\n\t\t\tstr = str[:len(str)-1]\n\t\t\texp++\n\t\t}\n\t} else {\n\t\texp = int32(-(len(str) - idx - 1))\n\t\tstr = str[:idx] + str[idx+1:]\n\t}\n\n\taccum := &big.Int{}\n\tif _, ok := accum.SetString(str, 10); !ok {\n\t\treturn nil, 0, fmt.Errorf(\"%s is not a number\", str)\n\t}\n\n\treturn accum, exp, nil\n}\n\n// nbaseDigitsToInt64 reads up to 4 nbase digits and packs them into an int64.\n// It stops early at digitsLeft or at the end of r, whichever comes first.\nfunc nbaseDigitsToInt64(r *pgio.Reader, digitsLeft int) (accum int64, digitsRead int) {\n\tdigits := min(digitsLeft, r.Remaining()/2, 4)\n\n\tfor i := range digits {\n\t\tif i > 0 {\n\t\t\taccum *= nbase\n\t\t}\n\t\taccum += int64(r.Uint16())\n\t}\n\n\treturn accum, digits","sourceCodeStart":181,"sourceCodeEnd":217,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/numeric.go#L181-L217","documentation":"Error \"%s is not a number\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/numeric.go:199 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}