{"record":{"id":"fd06272809e723da","repo":"jackc/pgx","slug":"unknown-lowertype-v","errorCode":null,"errorMessage":"unknown LowerType: %v","messagePattern":"unknown LowerType: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/range_codec.go","lineNumber":93,"sourceCode":"\n\tif getter.IsNull() {\n\t\treturn nil, nil\n\t}\n\n\tlowerType, upperType := getter.BoundTypes()\n\tlower, upper := getter.Bounds()\n\n\tvar rangeType byte\n\tswitch lowerType {\n\tcase Inclusive:\n\t\trangeType |= lowerInclusiveMask\n\tcase Unbounded:\n\t\trangeType |= lowerUnboundedMask\n\tcase Exclusive:\n\tcase Empty:\n\t\treturn append(buf, emptyMask), nil\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown LowerType: %v\", lowerType)\n\t}\n\n\tswitch upperType {\n\tcase Inclusive:\n\t\trangeType |= upperInclusiveMask\n\tcase Unbounded:\n\t\trangeType |= upperUnboundedMask\n\tcase Exclusive:\n\tdefault:\n\t\treturn nil, fmt.Errorf(\"unknown UpperType: %v\", upperType)\n\t}\n\n\tbuf = append(buf, rangeType)\n\n\tif lowerType != Unbounded {\n\t\tif lower == nil {\n\t\t\treturn nil, fmt.Errorf(\"Lower cannot be NULL unless LowerType is Unbounded\")\n\t\t}","sourceCodeStart":75,"sourceCodeEnd":111,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/range_codec.go#L75-L111","documentation":"While building the binary range flags byte, the value's LowerType is not one of Inclusive, Unbounded, Exclusive, or Empty. This fires only for a corrupted or manually constructed BoundType outside the defined enum, since normal code cannot produce other values.","triggerScenarios":"Thrown at pgtype/range_codec.go:93 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure LowerType is set from the pgtype BoundType constants only","Do not cast arbitrary integers to BoundType","Re-initialize range values instead of reusing memory with stale fields"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}