jackc/pgx · error

cannot scan into *pgtype.DriverBytes from QueryRow

Error message

cannot scan into *pgtype.DriverBytes from QueryRow

What it means

Error "cannot scan into *pgtype.DriverBytes from QueryRow" thrown in jackc/pgx.

Source

Thrown at rows.go:105

type RowScanner interface {
	// ScanRows scans the row.
	ScanRow(rows Rows) error
}

// connRow implements the Row interface for Conn.QueryRow.
type connRow baseRows

func (r *connRow) Scan(dest ...any) (err error) {
	rows := (*baseRows)(r)

	if rows.Err() != nil {
		return rows.Err()
	}

	for _, d := range dest {
		if _, ok := d.(*pgtype.DriverBytes); ok {
			rows.Close()
			return fmt.Errorf("cannot scan into *pgtype.DriverBytes from QueryRow")
		}
	}

	if !rows.Next() {
		if rows.Err() == nil {
			return ErrNoRows
		}
		return rows.Err()
	}

	rows.Scan(dest...)
	rows.Close()
	return rows.Err()
}

// baseRows implements the Rows interface for Conn.Query.
type baseRows struct {
	typeMap      *pgtype.Map

View on GitHub (pinned to ec1a0befd2)

When it happens

Trigger: Thrown at rows.go:105 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/ab72fbdd08884dd1.json. Report an issue: GitHub.