jackc/pgx · error
%d is less than minimum value for int4
Error message
%d is less than minimum value for int4
What it means
Error "%d is less than minimum value for int4" thrown in jackc/pgx.
Source
Thrown at pgtype/int.go:759
}
type encodePlanInt4CodecBinaryInt64Valuer struct{}
func (encodePlanInt4CodecBinaryInt64Valuer) Encode(value any, buf []byte) (newBuf []byte, err error) {
n, err := value.(Int64Valuer).Int64Value()
if err != nil {
return nil, err
}
if !n.Valid {
return nil, nil
}
if n.Int64 > math.MaxInt32 {
return nil, fmt.Errorf("%d is greater than maximum value for int4", n.Int64)
}
if n.Int64 < math.MinInt32 {
return nil, fmt.Errorf("%d is less than minimum value for int4", n.Int64)
}
return pgio.AppendInt32(buf, int32(n.Int64)), nil
}
type encodePlanInt4CodecTextInt64Valuer struct{}
func (encodePlanInt4CodecTextInt64Valuer) Encode(value any, buf []byte) (newBuf []byte, err error) {
n, err := value.(Int64Valuer).Int64Value()
if err != nil {
return nil, err
}
if !n.Valid {
return nil, nil
}
if n.Int64 > math.MaxInt32 {View on GitHub (pinned to ec1a0befd2)
When it happens
Trigger: Thrown at pgtype/int.go:759 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/7e6e886b4d9fdc1f.json.
Report an issue: GitHub.