{"id":"428409458a7ee902","repo":"jackc/pgx","slug":"int4-w","errorCode":null,"errorMessage":"int4: %w","messagePattern":"int4: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/int.go","lineNumber":882,"sourceCode":"\n\tvar n int32\n\terr := codecScan(c, m, oid, format, src, &n)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn n, nil\n}\n\ntype scanPlanBinaryInt4ToInt8 struct{}\n\nfunc (scanPlanBinaryInt4ToInt8) Scan(src []byte, dst any) error {\n\tif src == nil {\n\t\treturn fmt.Errorf(\"cannot scan NULL into %T\", dst)\n\t}\n\n\traw, err := pgio.Uint32Exact(src)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"int4: %w\", err)\n\t}\n\n\tp, ok := (dst).(*int8)\n\tif !ok {\n\t\treturn ErrScanTargetTypeChanged\n\t}\n\n\tn := int32(raw)\n\tif n < math.MinInt8 {\n\t\treturn fmt.Errorf(\"%d is less than minimum value for int8\", n)\n\t} else if n > math.MaxInt8 {\n\t\treturn fmt.Errorf(\"%d is greater than maximum value for int8\", n)\n\t}\n\n\t*p = int8(n)\n\n\treturn nil\n}","sourceCodeStart":864,"sourceCodeEnd":900,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/int.go#L864-L900","documentation":"Error \"int4: %w\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/int.go:882 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}