{"id":"766a215ac97a2f4b","repo":"jackc/pgx","slug":"invalid-tsvector-format-expected-position-number","errorCode":null,"errorMessage":"invalid tsvector format: expected position number","messagePattern":"invalid tsvector format: expected position number","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/tsvector.go","lineNumber":428,"sourceCode":"\t\t\tbreak\n\t\t}\n\n\t\tp.consume() // skip ','\n\t}\n\n\treturn positions, nil\n}\n\n// consumePosition consumes a single position number with optional weight letter.\nfunc (p *tsvectorParser) consumePosition() (TSVectorPosition, error) {\n\tstart := p.pos\n\n\tfor !p.atEnd() && p.peek() >= '0' && p.peek() <= '9' {\n\t\tp.consume()\n\t}\n\n\tif p.pos == start {\n\t\treturn TSVectorPosition{}, fmt.Errorf(\"invalid tsvector format: expected position number\")\n\t}\n\n\tnum, err := strconv.ParseUint(p.str[start:p.pos], 10, 16)\n\tif err != nil {\n\t\treturn TSVectorPosition{}, fmt.Errorf(\"invalid tsvector format: invalid position number %q\", p.str[start:p.pos])\n\t}\n\n\tpos := TSVectorPosition{Position: uint16(num), Weight: TSVectorWeightD}\n\n\t// Check for optional weight letter\n\tif !p.atEnd() {\n\t\tswitch p.peek() {\n\t\tcase 'A', 'a':\n\t\t\tpos.Weight = TSVectorWeightA\n\t\tcase 'B', 'b':\n\t\t\tpos.Weight = TSVectorWeightB\n\t\tcase 'C', 'c':\n\t\t\tpos.Weight = TSVectorWeightC","sourceCodeStart":410,"sourceCodeEnd":446,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/tsvector.go#L410-L446","documentation":"Error \"invalid tsvector format: expected position number\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/tsvector.go:428 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}