{"id":"7c9dc0f1b8692ecf","repo":"jackc/pgx","slug":"cannot-scan-s-oid-d-in-v-format-into-t","errorCode":null,"errorMessage":"cannot scan %s (OID %d) in %v format into %T","messagePattern":"cannot scan (.+?) \\(OID (.+?)\\) in (.+?) format into %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/pgtype.go","lineNumber":483,"sourceCode":"\n\tvar format string\n\tswitch plan.formatCode {\n\tcase TextFormatCode:\n\t\tformat = \"text\"\n\tcase BinaryFormatCode:\n\t\tformat = \"binary\"\n\tdefault:\n\t\tformat = fmt.Sprintf(\"unknown %d\", plan.formatCode)\n\t}\n\n\tvar dataTypeName string\n\tif t, ok := plan.m.TypeForOID(plan.oid); ok {\n\t\tdataTypeName = t.Name\n\t} else {\n\t\tdataTypeName = \"unknown type\"\n\t}\n\n\treturn fmt.Errorf(\"cannot scan %s (OID %d) in %v format into %T\", dataTypeName, plan.oid, format, dst)\n}\n\n// TryWrapScanPlanFunc is a function that tries to create a wrapper plan for target. If successful it returns a plan\n// that will convert the target passed to Scan and then call the next plan. nextTarget is target as it will be converted\n// by plan. It must be used to find another suitable ScanPlan. When it is found SetNext must be called on plan for it\n// to be usabled. ok indicates if a suitable wrapper was found.\ntype TryWrapScanPlanFunc func(target any) (plan WrappedScanPlanNextSetter, nextTarget any, ok bool)\n\ntype pointerPointerScanPlan struct {\n\tdstType reflect.Type\n\tnext    ScanPlan\n}\n\nfunc (plan *pointerPointerScanPlan) SetNext(next ScanPlan) { plan.next = next }\n\nfunc (plan *pointerPointerScanPlan) Scan(src []byte, dst any) error {\n\tdstValue := reflect.ValueOf(dst)\n\tif dstValue.Kind() != reflect.Pointer || dstValue.IsNil() {","sourceCodeStart":465,"sourceCodeEnd":501,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/pgtype.go#L465-L501","documentation":"Error \"cannot scan %s (OID %d) in %v format into %T\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/pgtype.go:483 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}