jackc/pgx · error

%d is less than minimum value for uint32

Error message

%d is less than minimum value for uint32

What it means

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

Source

Thrown at pgtype/int.go:448

func (scanPlanBinaryInt2ToUint32) Scan(src []byte, dst any) error {
	if src == nil {
		return fmt.Errorf("cannot scan NULL into %T", dst)
	}

	raw, err := pgio.Uint16Exact(src)
	if err != nil {
		return fmt.Errorf("uint2: %w", err)
	}

	p, ok := (dst).(*uint32)
	if !ok {
		return ErrScanTargetTypeChanged
	}

	n := int16(raw)
	if n < 0 {
		return fmt.Errorf("%d is less than minimum value for uint32", n)
	}

	*p = uint32(n)

	return nil
}

type scanPlanBinaryInt2ToInt64 struct{}

func (scanPlanBinaryInt2ToInt64) Scan(src []byte, dst any) error {
	if src == nil {
		return fmt.Errorf("cannot scan NULL into %T", dst)
	}

	raw, err := pgio.Uint16Exact(src)
	if err != nil {
		return fmt.Errorf("int2: %w", err)
	}

View on GitHub (pinned to ec1a0befd2)

When it happens

Trigger: Thrown at pgtype/int.go:448 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/85f5815830595671.json. Report an issue: GitHub.