{"id":"81455065689bb807","repo":"jackc/pgx","slug":"invalid-tsvector-format-unexpected-end-after-back","errorCode":null,"errorMessage":"invalid tsvector format: unexpected end after backslash","messagePattern":"invalid tsvector format: unexpected end after backslash","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/tsvector.go","lineNumber":389,"sourceCode":"\t\tch, end := p.consume()\n\t\tif end {\n\t\t\treturn \"\", fmt.Errorf(\"invalid tsvector format: unterminated quoted lexeme\")\n\t\t}\n\n\t\tswitch ch {\n\t\tcase '\\'':\n\t\t\t// Escaped quote ('') — write a literal single quote\n\t\t\tif !p.atEnd() && p.peek() == '\\'' {\n\t\t\t\tp.consume()\n\t\t\t\tbuf.WriteByte('\\'')\n\t\t\t} else {\n\t\t\t\t// Closing quote — lexeme is complete\n\t\t\t\treturn buf.String(), nil\n\t\t\t}\n\t\tcase '\\\\':\n\t\t\tnext, end := p.consume()\n\t\t\tif end {\n\t\t\t\treturn \"\", fmt.Errorf(\"invalid tsvector format: unexpected end after backslash\")\n\t\t\t}\n\t\t\tbuf.WriteByte(next)\n\t\tdefault:\n\t\t\tbuf.WriteByte(ch)\n\t\t}\n\t}\n}\n\n// consumePositions consumes a comma-separated list of position[weight] values.\nfunc (p *tsvectorParser) consumePositions() ([]TSVectorPosition, error) {\n\tvar positions []TSVectorPosition\n\n\tfor {\n\t\tpos, err := p.consumePosition()\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tpositions = append(positions, pos)","sourceCodeStart":371,"sourceCodeEnd":407,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/tsvector.go#L371-L407","documentation":"Error \"invalid tsvector format: unexpected end after backslash\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/tsvector.go:389 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}