{"id":"a4686e270f349f89","repo":"jackc/pgx","slug":"cannot-scan-null-into-int8","errorCode":null,"errorMessage":"cannot scan NULL into *int8","messagePattern":"cannot scan NULL into \\*int8","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/builtin_wrappers.go","lineNumber":20,"sourceCode":"\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"math\"\n\t\"math/big\"\n\t\"net\"\n\t\"net/netip\"\n\t\"reflect\"\n\t\"time\"\n)\n\ntype int8Wrapper int8\n\nfunc (w int8Wrapper) SkipUnderlyingTypePlan() {}\n\nfunc (w *int8Wrapper) ScanInt64(v Int8) error {\n\tif !v.Valid {\n\t\treturn fmt.Errorf(\"cannot scan NULL into *int8\")\n\t}\n\n\tif v.Int64 < math.MinInt8 {\n\t\treturn fmt.Errorf(\"%d is less than minimum value for int8\", v.Int64)\n\t}\n\tif v.Int64 > math.MaxInt8 {\n\t\treturn fmt.Errorf(\"%d is greater than maximum value for int8\", v.Int64)\n\t}\n\t*w = int8Wrapper(v.Int64)\n\n\treturn nil\n}\n\nfunc (w int8Wrapper) Int64Value() (Int8, error) {\n\treturn Int8{Int64: int64(w), Valid: true}, nil\n}\n\ntype int16Wrapper int16","sourceCodeStart":2,"sourceCodeEnd":38,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/builtin_wrappers.go#L2-L38","documentation":"Error \"cannot scan NULL into *int8\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/builtin_wrappers.go:20 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}