{"record":{"id":"89fae5e0b23eb3ce","repo":"jackc/pgx","slug":"expected-c-v-found-c-v","errorCode":null,"errorMessage":"expected '%c' ('%#v'); found '%c' ('%#v')","messagePattern":"expected '%c' \\('%#v'\\); found '%c' \\('%#v'\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/hstore.go","lineNumber":292,"sourceCode":"\t}\n}\n\nfunc (p *hstoreParser) atEnd() bool {\n\treturn p.pos >= len(p.str)\n}\n\n// consume returns the next byte of the string, or end if the string is done.\nfunc (p *hstoreParser) consume() (b byte, end bool) {\n\tif p.pos >= len(p.str) {\n\t\treturn 0, true\n\t}\n\tb = p.str[p.pos]\n\tp.pos++\n\treturn b, false\n}\n\nfunc unexpectedByteErr(actualB, expectedB byte) error {\n\treturn fmt.Errorf(\"expected '%c' ('%#v'); found '%c' ('%#v')\", expectedB, expectedB, actualB, actualB)\n}\n\n// consumeExpectedByte consumes expectedB from the string, or returns an error.\nfunc (p *hstoreParser) consumeExpectedByte(expectedB byte) error {\n\tnextB, end := p.consume()\n\tif end {\n\t\treturn fmt.Errorf(\"expected '%c' ('%#v'); found end\", expectedB, expectedB)\n\t}\n\tif nextB != expectedB {\n\t\treturn unexpectedByteErr(nextB, expectedB)\n\t}\n\treturn nil\n}\n\n// consumeExpected2 consumes two expected bytes or returns an error.\n// This was a bit faster than using a string argument (better inlining? Not sure).\nfunc (p *hstoreParser) consumeExpected2(one, two byte) error {\n\tif p.pos+2 > len(p.str) {","sourceCodeStart":274,"sourceCodeEnd":310,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/hstore.go#L274-L310","documentation":"Helper error from the hstore text parser: while consuming a required structural byte (quote, comma, arrow), a different byte was found. Both the expected and actual bytes are shown; the hstore literal is malformed at that position.","triggerScenarios":"Thrown at pgtype/hstore.go:292 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the hstore literal to 'key=>value, key2=>value2' syntax","Properly escape quotes and backslashes in keys and values"],"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"}