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/bits.go:47
}
// BitsValue implements the [BitsValuer] interface.
func (b Bits) BitsValue() (Bits, error) {
return b, nil
}
// Scan implements the [database/sql.Scanner] interface.
func (dst *Bits) Scan(src any) error {
if src == nil {
*dst = Bits{}
return nil
}
if src, ok := src.(string); ok {
return scanPlanTextAnyToBitsScanner{}.Scan([]byte(src), dst)
}
return fmt.Errorf("cannot scan %T", src)
}
// Value implements the [database/sql/driver.Valuer] interface.
func (src Bits) Value() (driver.Value, error) {
if !src.Valid {
return nil, nil
}
buf, err := BitsCodec{}.PlanEncode(nil, 0, TextFormatCode, src).Encode(src, nil)
if err != nil {
return nil, err
}
return string(buf), err
}
type BitsCodec struct{}
func (BitsCodec) FormatSupported(format int16) bool {View on GitHub (pinned to ec1a0befd2)
When it happens
Trigger: Thrown at pgtype/bits.go:47 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/336f0f047367e4c6.json.
Report an issue: GitHub.