{"id":"ab72fbdd08884dd1","repo":"jackc/pgx","slug":"cannot-scan-into-pgtype-driverbytes-from-queryrow","errorCode":null,"errorMessage":"cannot scan into *pgtype.DriverBytes from QueryRow","messagePattern":"cannot scan into \\*pgtype\\.DriverBytes from QueryRow","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"rows.go","lineNumber":105,"sourceCode":"type RowScanner interface {\n\t// ScanRows scans the row.\n\tScanRow(rows Rows) error\n}\n\n// connRow implements the Row interface for Conn.QueryRow.\ntype connRow baseRows\n\nfunc (r *connRow) Scan(dest ...any) (err error) {\n\trows := (*baseRows)(r)\n\n\tif rows.Err() != nil {\n\t\treturn rows.Err()\n\t}\n\n\tfor _, d := range dest {\n\t\tif _, ok := d.(*pgtype.DriverBytes); ok {\n\t\t\trows.Close()\n\t\t\treturn fmt.Errorf(\"cannot scan into *pgtype.DriverBytes from QueryRow\")\n\t\t}\n\t}\n\n\tif !rows.Next() {\n\t\tif rows.Err() == nil {\n\t\t\treturn ErrNoRows\n\t\t}\n\t\treturn rows.Err()\n\t}\n\n\trows.Scan(dest...)\n\trows.Close()\n\treturn rows.Err()\n}\n\n// baseRows implements the Rows interface for Conn.Query.\ntype baseRows struct {\n\ttypeMap      *pgtype.Map","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/rows.go#L87-L123","documentation":"Error \"cannot scan into *pgtype.DriverBytes from QueryRow\" thrown in jackc/pgx.","triggerScenarios":"Thrown at rows.go:105 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","schemaVersion":2}