{"id":"68c6d422b0da7c30","repo":"jackc/pgx","slug":"cannot-scan-t-68c6d4","errorCode":null,"errorMessage":"cannot scan %T","messagePattern":"cannot scan %T","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/hstore.go","lineNumber":46,"sourceCode":"}\n\n// HstoreValue implements the [HstoreValuer] interface.\nfunc (h Hstore) HstoreValue() (Hstore, error) {\n\treturn h, nil\n}\n\n// Scan implements the [database/sql.Scanner] interface.\nfunc (h *Hstore) Scan(src any) error {\n\tif src == nil {\n\t\t*h = nil\n\t\treturn nil\n\t}\n\n\tif src, ok := src.(string); ok {\n\t\treturn scanPlanTextAnyToHstoreScanner{}.scanString(src, h)\n\t}\n\n\treturn fmt.Errorf(\"cannot scan %T\", src)\n}\n\n// Value implements the [database/sql/driver.Valuer] interface.\nfunc (h Hstore) Value() (driver.Value, error) {\n\tif h == nil {\n\t\treturn nil, nil\n\t}\n\n\tbuf, err := HstoreCodec{}.PlanEncode(nil, 0, TextFormatCode, h).Encode(h, nil)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn string(buf), err\n}\n\ntype HstoreCodec struct{}\n\nfunc (HstoreCodec) FormatSupported(format int16) bool {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/hstore.go#L28-L64","documentation":"Error \"cannot scan %T\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/hstore.go:46 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}