{"id":"93f7e66f4bd064db","repo":"jackc/pgx","slug":"cannot-scan-t-93f7e6","errorCode":null,"errorMessage":"cannot scan %T","messagePattern":"cannot scan %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/date.go","lineNumber":58,"sourceCode":"\tinfinityDayOffset         = 2147483647\n)\n\n// Scan implements the [database/sql.Scanner] interface.\nfunc (dst *Date) Scan(src any) error {\n\tif src == nil {\n\t\t*dst = Date{}\n\t\treturn nil\n\t}\n\n\tswitch src := src.(type) {\n\tcase string:\n\t\treturn scanPlanTextAnyToDateScanner{}.Scan([]byte(src), dst)\n\tcase time.Time:\n\t\t*dst = Date{Time: src, Valid: true}\n\t\treturn nil\n\t}\n\n\treturn fmt.Errorf(\"cannot scan %T\", src)\n}\n\n// Value implements the [database/sql/driver.Valuer] interface.\nfunc (src Date) Value() (driver.Value, error) {\n\tif !src.Valid {\n\t\treturn nil, nil\n\t}\n\n\tif src.InfinityModifier != Finite {\n\t\treturn src.InfinityModifier.String(), nil\n\t}\n\treturn src.Time, nil\n}\n\n// MarshalJSON implements the [encoding/json.Marshaler] interface.\nfunc (src Date) MarshalJSON() ([]byte, error) {\n\tif !src.Valid {\n\t\treturn []byte(\"null\"), nil","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/date.go#L40-L76","documentation":"Error \"cannot scan %T\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/date.go:58 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}