{"record":{"id":"422d162ac595f8cb","repo":"jackc/pgx","slug":"time-w","errorCode":null,"errorMessage":"time: %w","messagePattern":"time: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/time.go","lineNumber":168,"sourceCode":"\t\t\treturn scanPlanTextAnyToTimeScanner{}\n\t\t}\n\t}\n\n\treturn nil\n}\n\ntype scanPlanBinaryTimeToTimeScanner struct{}\n\nfunc (scanPlanBinaryTimeToTimeScanner) Scan(src []byte, dst any) error {\n\tscanner := (dst).(TimeScanner)\n\n\tif src == nil {\n\t\treturn scanner.ScanTime(Time{})\n\t}\n\n\traw, err := pgio.Uint64Exact(src)\n\tif err != nil {\n\t\treturn fmt.Errorf(\"time: %w\", err)\n\t}\n\n\tusec := int64(raw)\n\n\treturn scanner.ScanTime(Time{Microseconds: usec, Valid: true})\n}\n\ntype scanPlanBinaryTimeToTextScanner struct{}\n\nfunc (scanPlanBinaryTimeToTextScanner) Scan(src []byte, dst any) error {\n\tts, ok := (dst).(TextScanner)\n\tif !ok {\n\t\treturn ErrScanTargetTypeChanged\n\t}\n\n\tif src == nil {\n\t\treturn ts.ScanText(Text{})\n\t}","sourceCodeStart":150,"sourceCodeEnd":186,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/time.go#L150-L186","documentation":"scanPlanBinaryTimeToTimeScanner wraps pgio.Uint64Exact: the binary time-of-day payload was not exactly 8 bytes, so the microseconds value cannot be read. The wrapped error details the size mismatch.","triggerScenarios":"Thrown at pgtype/time.go:168 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Treat the value as corrupt and fail the scan","Verify the column is a time type and the binary payload is 8 bytes","Check for truncation in custom transport or buffering code"],"exampleFix":null,"handlingStrategy":"validation","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"}