jackc/pgx · error
range too short: %v
Error message
range too short: %v
What it means
Error "range too short: %v" thrown in jackc/pgx.
Source
Thrown at pgtype/range.go:209
// 16 = ( = 10000
// 18 = [ = 10010
// 24 = = 11000
const (
emptyMask = 1
lowerInclusiveMask = 2
upperInclusiveMask = 4
lowerUnboundedMask = 8
upperUnboundedMask = 16
)
func parseUntypedBinaryRange(src []byte) (*untypedBinaryRange, error) {
ubr := &untypedBinaryRange{}
r := pgio.NewReader(src)
rangeType := r.Byte()
if r.Err() != nil {
return nil, fmt.Errorf("range too short: %v", len(src))
}
if rangeType&emptyMask > 0 {
if err := r.Finish(); err != nil {
return nil, fmt.Errorf("empty range: %w", err)
}
ubr.LowerType = Empty
ubr.UpperType = Empty
return ubr, nil
}
switch {
case rangeType&lowerInclusiveMask > 0:
ubr.LowerType = Inclusive
case rangeType&lowerUnboundedMask > 0:
ubr.LowerType = Unbounded
default:
ubr.LowerType = ExclusiveView on GitHub (pinned to ec1a0befd2)
When it happens
Trigger: Thrown at pgtype/range.go:209 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of jackc/pgx@ec1a0befd2 (2026-08-04).
Data as JSON: /data/errors/feff380b212458a4.json.
Report an issue: GitHub.