{"id":"be87a4f3c5fbc490","repo":"jackc/pgx","slug":"range-upper-bound-cannot-be-null","errorCode":null,"errorMessage":"range upper bound cannot be NULL","messagePattern":"range upper bound cannot be NULL","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/range.go","lineNumber":250,"sourceCode":"\t\tubr.UpperType = Inclusive\n\tcase rangeType&upperUnboundedMask > 0:\n\t\tubr.UpperType = Unbounded\n\tdefault:\n\t\tubr.UpperType = Exclusive\n\t}\n\n\tif ubr.LowerType != Unbounded {\n\t\tval, null := r.Value()\n\t\tif null {\n\t\t\treturn nil, fmt.Errorf(\"range lower bound cannot be NULL\")\n\t\t}\n\t\tubr.Lower = val\n\t}\n\n\tif ubr.UpperType != Unbounded {\n\t\tval, null := r.Value()\n\t\tif null {\n\t\t\treturn nil, fmt.Errorf(\"range upper bound cannot be NULL\")\n\t\t}\n\t\tubr.Upper = val\n\t}\n\n\tif err := r.Finish(); err != nil {\n\t\treturn nil, fmt.Errorf(\"range: %w\", err)\n\t}\n\n\treturn ubr, nil\n}\n\n// Range is a generic range type.\ntype Range[T any] struct {\n\tLower     T\n\tUpper     T\n\tLowerType BoundType\n\tUpperType BoundType\n\tValid     bool","sourceCodeStart":232,"sourceCodeEnd":268,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/range.go#L232-L268","documentation":"Error \"range upper bound cannot be NULL\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/range.go:250 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}