{"id":"3020d6764eddd672","repo":"jackc/pgx","slug":"hstore-w","errorCode":null,"errorMessage":"hstore: %w","messagePattern":"hstore: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/hstore.go","lineNumber":194,"sourceCode":"\treturn nil\n}\n\ntype scanPlanBinaryHstoreToHstoreScanner struct{}\n\nfunc (scanPlanBinaryHstoreToHstoreScanner) Scan(src []byte, dst any) error {\n\tscanner := (dst).(HstoreScanner)\n\n\tif src == nil {\n\t\treturn scanner.ScanHstore(Hstore(nil))\n\t}\n\n\tr := pgio.NewReader(src)\n\n\t// Each pair carries at minimum two int32 length headers (key, value). This bounds the\n\t// up-front make() against a malicious server claiming a huge pair count in a small message.\n\tpairCount := r.Count(8)\n\tif err := r.Err(); err != nil {\n\t\treturn fmt.Errorf(\"hstore: %w\", err)\n\t}\n\n\thstore := make(Hstore, pairCount)\n\t// one allocation for all *string, rather than one per string, just like text parsing\n\tvalueStrings := make([]string, pairCount)\n\n\tfor i := range pairCount {\n\t\tkeyBytes, keyNull := r.Value()\n\t\tvalueBytes, valueNull := r.Value()\n\t\tif err := r.Err(); err != nil {\n\t\t\treturn fmt.Errorf(\"hstore pair %d: %w\", i, err)\n\t\t}\n\t\tif keyNull {\n\t\t\treturn fmt.Errorf(\"hstore pair %d: key cannot be NULL\", i)\n\t\t}\n\n\t\tkey := string(keyBytes)\n\t\tif valueNull {","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/hstore.go#L176-L212","documentation":"Error \"hstore: %w\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/hstore.go:194 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}