{"id":"b022434fdbc9661e","repo":"jackc/pgx","slug":"unexpected-escape-in-quoted-string-found-v","errorCode":null,"errorMessage":"unexpected escape in quoted string: found '%#v'","messagePattern":"unexpected escape in quoted string: found '%#v'","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/hstore.go","lineNumber":378,"sourceCode":"\tp.pos = firstBackslash\n\n\t// copy bytes until the end, unescaping backslashes\nquotedString:\n\tfor {\n\t\tnextB, end := p.consume()\n\t\tswitch {\n\t\tcase end:\n\t\t\treturn \"\", errEOSInQuoted\n\t\tcase nextB == '\"':\n\t\t\tbreak quotedString\n\t\tcase nextB == '\\\\':\n\t\t\t// escape: skip the backslash and copy the char\n\t\t\tnextB, end = p.consume()\n\t\t\tif end {\n\t\t\t\treturn \"\", errEOSInQuoted\n\t\t\t}\n\t\t\tif !(nextB == '\\\\' || nextB == '\"') {\n\t\t\t\treturn \"\", fmt.Errorf(\"unexpected escape in quoted string: found '%#v'\", nextB)\n\t\t\t}\n\t\t\tbuilder.WriteByte(nextB)\n\t\tdefault:\n\t\t\t// normal byte: copy it\n\t\t\tbuilder.WriteByte(nextB)\n\t\t}\n\t}\n\treturn builder.String(), nil\n}\n\n// consumePairSeparator consumes the Hstore pair separator \", \" or returns an error.\nfunc (p *hstoreParser) consumePairSeparator() error {\n\treturn p.consumeExpected2(',', ' ')\n}\n\n// consumeKVSeparator consumes the Hstore key/value separator \"=>\" or returns an error.\nfunc (p *hstoreParser) consumeKVSeparator() error {\n\treturn p.consumeExpected2('=', '>')","sourceCodeStart":360,"sourceCodeEnd":396,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/hstore.go#L360-L396","documentation":"Error \"unexpected escape in quoted string: found '%#v'\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/hstore.go:378 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}