{"id":"1036271ae639b4a2","repo":"jackc/pgx","slug":"unable-to-encode-v-into-oid-d-in-binary-format","errorCode":null,"errorMessage":"unable to encode %v into OID %d in binary format","messagePattern":"unable to encode (.+?) into OID (.+?) in binary format","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/composite.go","lineNumber":149,"sourceCode":"\nfunc (plan *scanPlanBinaryCompositeToCompositeIndexScanner) Scan(src []byte, target any) error {\n\ttargetScanner := (target).(CompositeIndexScanner)\n\n\tif src == nil {\n\t\treturn targetScanner.ScanNull()\n\t}\n\n\tscanner := NewCompositeBinaryScanner(plan.m, src)\n\tfor i, field := range plan.cc.Fields {\n\t\tif scanner.Next() {\n\t\t\tfieldTarget, err := compositeFieldTarget(targetScanner, i)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\tif fieldTarget != nil {\n\t\t\t\tfieldPlan := plan.m.PlanScan(field.Type.OID, BinaryFormatCode, fieldTarget)\n\t\t\t\tif fieldPlan == nil {\n\t\t\t\t\treturn fmt.Errorf(\"unable to encode %v into OID %d in binary format\", field, field.Type.OID)\n\t\t\t\t}\n\n\t\t\t\terr = fieldPlan.Scan(scanner.Bytes(), fieldTarget)\n\t\t\t\tif err != nil {\n\t\t\t\t\treturn err\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\treturn errors.New(\"read past end of composite\")\n\t\t}\n\t}\n\n\tif err := scanner.Err(); err != nil {\n\t\treturn err\n\t}\n\n\treturn nil\n}","sourceCodeStart":131,"sourceCodeEnd":167,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/composite.go#L131-L167","documentation":"Error \"unable to encode %v into OID %d in binary format\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/composite.go:149 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}