{"record":{"id":"1276d9d8889269e4","repo":"jackc/pgx","slug":"planscan-did-not-find-a-plan","errorCode":null,"errorMessage":"PlanScan did not find a plan","messagePattern":"PlanScan did not find a plan","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/pgtype.go","lineNumber":1176,"sourceCode":"\n\treturn &scanPlanFail{m: m, oid: oid, formatCode: formatCode}\n}\n\nfunc (m *Map) Scan(oid uint32, formatCode int16, src []byte, dst any) error {\n\tif dst == nil {\n\t\treturn nil\n\t}\n\n\tplan := m.PlanScan(oid, formatCode, dst)\n\treturn plan.Scan(src, dst)\n}\n\nvar ErrScanTargetTypeChanged = errors.New(\"scan target type changed\")\n\nfunc codecScan(codec Codec, m *Map, oid uint32, format int16, src []byte, dst any) error {\n\tscanPlan := codec.PlanScan(m, oid, format, dst)\n\tif scanPlan == nil {\n\t\treturn fmt.Errorf(\"PlanScan did not find a plan\")\n\t}\n\treturn scanPlan.Scan(src, dst)\n}\n\nfunc codecDecodeToTextFormat(codec Codec, m *Map, oid uint32, format int16, src []byte) (driver.Value, error) {\n\tif src == nil {\n\t\treturn nil, nil\n\t}\n\n\tif format == TextFormatCode {\n\t\treturn string(src), nil\n\t} else {\n\t\tvalue, err := codec.DecodeValue(m, oid, format, src)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tbuf, err := m.Encode(oid, TextFormatCode, value, nil)\n\t\tif err != nil {","sourceCodeStart":1158,"sourceCodeEnd":1194,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/pgtype.go#L1158-L1194","documentation":"codecScan is the fallback path that asks a codec directly for a scan plan; this guard fires when the codec's PlanScan returns nil for the given destination — the codec cannot scan that Go type in that format. It mirrors the Map-level scanPlanFail but without its descriptive context.","triggerScenarios":"Thrown at pgtype/pgtype.go:1176 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Scan into a destination type the codec supports","Wrap the destination with a scan-plan wrapper registered via TryWrapScanPlanFunc","Use a different format code (text vs binary) for the column"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ec1a0befd22592cffffdeeb0a50311b506372f4c","analyzedAt":"2026-08-04T22:52:11.263Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}