{"id":"bc79184fbc8eb2b1","repo":"jackc/pgx","slug":"composite-text-format-unterminated-quoted-field","errorCode":null,"errorMessage":"composite text format unterminated quoted field","messagePattern":"composite text format unterminated quoted field","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/composite.go","lineNumber":414,"sourceCode":"\n\tif cfs.rp >= len(cfs.src) {\n\t\treturn false\n\t}\n\n\tswitch cfs.src[cfs.rp] {\n\tcase ',', ')': // null\n\t\tcfs.rp++\n\t\tcfs.fieldBytes = nil\n\t\treturn true\n\tcase '\"': // quoted value\n\t\tcfs.rp++\n\t\tcfs.fieldBytes = make([]byte, 0, 16)\n\tquotedValue:\n\t\tfor {\n\t\t\t// A quote or escape may have consumed the final ')', leaving an\n\t\t\t// unterminated quoted field.\n\t\t\tif cfs.rp >= len(cfs.src) {\n\t\t\t\tcfs.err = fmt.Errorf(\"composite text format unterminated quoted field\")\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tch := cfs.src[cfs.rp]\n\n\t\t\tswitch ch {\n\t\t\tcase '\"':\n\t\t\t\tcfs.rp++\n\t\t\t\tif cfs.rp < len(cfs.src) && cfs.src[cfs.rp] == '\"' {\n\t\t\t\t\tcfs.fieldBytes = append(cfs.fieldBytes, '\"')\n\t\t\t\t\tcfs.rp++\n\t\t\t\t} else {\n\t\t\t\t\tbreak quotedValue\n\t\t\t\t}\n\t\t\tcase '\\\\':\n\t\t\t\tcfs.rp++\n\t\t\t\tif cfs.rp >= len(cfs.src) {\n\t\t\t\t\tcfs.err = fmt.Errorf(\"composite text format unterminated quoted field\")\n\t\t\t\t\treturn false","sourceCodeStart":396,"sourceCodeEnd":432,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/composite.go#L396-L432","documentation":"Error \"composite text format unterminated quoted field\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgtype/composite.go:414 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}