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/path.go:49

}

// PathValue implements the [PathValuer] interface.
func (path Path) PathValue() (Path, error) {
	return path, nil
}

// Scan implements the [database/sql.Scanner] interface.
func (path *Path) Scan(src any) error {
	if src == nil {
		*path = Path{}
		return nil
	}

	if src, ok := src.(string); ok {
		return scanPlanTextAnyToPathScanner{}.Scan([]byte(src), path)
	}

	return fmt.Errorf("cannot scan %T", src)
}

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

	buf, err := PathCodec{}.PlanEncode(nil, 0, TextFormatCode, path).Encode(path, nil)
	if err != nil {
		return nil, err
	}

	return string(buf), err
}

type PathCodec struct{}

View on GitHub (pinned to ec1a0befd2)

When it happens

Trigger: Thrown at pgtype/path.go:49 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/ebf310490d4ed621.json. Report an issue: GitHub.