jackc/pgx · error

numeric incomplete: %w

Error message

numeric incomplete: %w

What it means

Error "numeric incomplete: %w" thrown in jackc/pgx.

Source

Thrown at pgtype/numeric.go:637

}

type scanPlanBinaryNumericToNumericScanner struct{}

func (scanPlanBinaryNumericToNumericScanner) Scan(src []byte, dst any) error {
	scanner := (dst).(NumericScanner)

	if src == nil {
		return scanner.ScanNumeric(Numeric{})
	}

	r := pgio.NewReader(src)

	ndigits := r.Uint16()
	weight := r.Int16()
	sign := r.Uint16()
	dscale := r.Int16()
	if err := r.Err(); err != nil {
		return fmt.Errorf("numeric incomplete: %w", err)
	}

	switch sign {
	case pgNumericNaNSign:
		return scanner.ScanNumeric(Numeric{NaN: true, Valid: true})
	case pgNumericPosInfSign:
		return scanner.ScanNumeric(Numeric{InfinityModifier: Infinity, Valid: true})
	case pgNumericNegInfSign:
		return scanner.ScanNumeric(Numeric{InfinityModifier: NegativeInfinity, Valid: true})
	}

	if ndigits == 0 {
		return scanner.ScanNumeric(Numeric{Int: big.NewInt(0), Valid: true})
	}

	if r.Remaining() < int(ndigits)*2 {
		return fmt.Errorf("numeric incomplete %v", src)
	}

View on GitHub (pinned to ec1a0befd2)

When it happens

Trigger: Thrown at pgtype/numeric.go:637 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/a76fe3c1646e9be8.json. Report an issue: GitHub.