{"record":{"id":"ca373b15a9d89cf6","repo":"jackc/pgx","slug":"missing-upper-bound-w","errorCode":null,"errorMessage":"missing upper bound: %w","messagePattern":"missing upper bound: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/range.go","lineNumber":94,"sourceCode":"\t}\n\n\tr, _, err = buf.ReadRune()\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"invalid upper value: %w\", err)\n\t}\n\n\tif r == ')' || r == ']' {\n\t\tutr.UpperType = Unbounded\n\t} else {\n\t\tbuf.UnreadRune()\n\t\tutr.Upper, err = rangeParseValue(buf)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"invalid upper value: %w\", err)\n\t\t}\n\n\t\tr, _, err = buf.ReadRune()\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"missing upper bound: %w\", err)\n\t\t}\n\t\tswitch r {\n\t\tcase ')':\n\t\t\tutr.UpperType = Exclusive\n\t\tcase ']':\n\t\t\tutr.UpperType = Inclusive\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"missing upper bound, instead got: %v\", string(r))\n\t\t}\n\t}\n\n\tskipWhitespace(buf)\n\n\tif buf.Len() > 0 {\n\t\treturn nil, fmt.Errorf(\"unexpected trailing data: %v\", buf.String())\n\t}\n\n\treturn utr, nil","sourceCodeStart":76,"sourceCodeEnd":112,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/range.go#L76-L112","documentation":"parseUntypedTextRange read the upper bound value but then hit EOF (ReadRune error) before finding the closing ')' or ']'. The range literal's upper bound is missing its terminator, so the wrapped read error is reported.","triggerScenarios":"Thrown at pgtype/range.go:94 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure the range literal ends with ')' or ']'","Pre-validate the bracket balance of range strings","Round-trip the value through the database to normalize formatting"],"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"}