jackc/pgx · error

cannot scan %T

Error message

cannot scan %T

What it means

Error "cannot scan %T" thrown in jackc/pgx.

Source

Thrown at pgtype/uint64.go:59

		return nil
	}

	var n uint64

	switch src := src.(type) {
	case int64:
		if src < 0 {
			return fmt.Errorf("%d is less than the minimum value for Uint64", src)
		}
		n = uint64(src)
	case string:
		un, err := strconv.ParseUint(src, 10, 64)
		if err != nil {
			return err
		}
		n = un
	default:
		return fmt.Errorf("cannot scan %T", src)
	}

	*dst = Uint64{Uint64: n, Valid: true}

	return nil
}

// Value implements the [database/sql/driver.Valuer] interface.
func (src Uint64) Value() (driver.Value, error) {
	if !src.Valid {
		return nil, nil
	}

	// If the value is greater than the maximum value for int64, return it as a string instead of losing data or returning
	// an error.
	if src.Uint64 > math.MaxInt64 {
		return strconv.FormatUint(src.Uint64, 10), nil
	}

View on GitHub (pinned to ec1a0befd2)

When it happens

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