jackc/pgx · error

%d is less than minimum value for uint64

Error message

%d is less than minimum value for uint64

What it means

Error "%d is less than minimum value for uint64" thrown in jackc/pgx.

Source

Thrown at pgtype/uint64.go:150

	}

	return pgio.AppendUint64(buf, v.Uint64), nil
}

type encodePlanUint64CodecBinaryInt64Valuer struct{}

func (encodePlanUint64CodecBinaryInt64Valuer) Encode(value any, buf []byte) (newBuf []byte, err error) {
	v, err := value.(Int64Valuer).Int64Value()
	if err != nil {
		return nil, err
	}

	if !v.Valid {
		return nil, nil
	}

	if v.Int64 < 0 {
		return nil, fmt.Errorf("%d is less than minimum value for uint64", v.Int64)
	}

	return pgio.AppendUint64(buf, uint64(v.Int64)), nil
}

type encodePlanUint64CodecTextUint64 struct{}

func (encodePlanUint64CodecTextUint64) Encode(value any, buf []byte) (newBuf []byte, err error) {
	v := value.(uint64)
	return append(buf, strconv.FormatUint(v, 10)...), nil
}

type encodePlanUint64CodecTextUint64Valuer struct{}

func (encodePlanUint64CodecTextUint64Valuer) Encode(value any, buf []byte) (newBuf []byte, err error) {
	v, err := value.(Uint64Valuer).Uint64Value()
	if err != nil {
		return nil, err

View on GitHub (pinned to ec1a0befd2)

When it happens

Trigger: Thrown at pgtype/uint64.go:150 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/6b7fbb7bb25bfa14.json. Report an issue: GitHub.