{"record":{"id":"16f4630d156fa7c9","repo":"jackc/pgx","slug":"invalid-array-value-w","errorCode":null,"errorMessage":"invalid array value: %w","messagePattern":"invalid array value: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/array.go","lineNumber":215,"sourceCode":"\t\t}\n\n\t\tswitch r {\n\t\tcase '{':\n\t\t\tif currentDim == counterDim {\n\t\t\t\timplicitDimensions[currentDim].Length++\n\t\t\t}\n\t\t\tcurrentDim++\n\t\tcase ',':\n\t\tcase '}':\n\t\t\tcurrentDim--\n\t\t\tif currentDim < counterDim {\n\t\t\t\tcounterDim = currentDim\n\t\t\t}\n\t\tdefault:\n\t\t\tbuf.UnreadRune()\n\t\t\tvalue, quoted, err := arrayParseValue(buf)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid array value: %w\", err)\n\t\t\t}\n\t\t\tif currentDim == counterDim {\n\t\t\t\timplicitDimensions[currentDim].Length++\n\t\t\t}\n\t\t\tdst.Quoted = append(dst.Quoted, quoted)\n\t\t\tdst.Elements = append(dst.Elements, value)\n\t\t}\n\n\t\tif currentDim < 0 {\n\t\t\tbreak\n\t\t}\n\t}\n\n\tskipWhitespace(buf)\n\n\tif buf.Len() > 0 {\n\t\treturn nil, fmt.Errorf(\"unexpected trailing data: %v\", buf.String())\n\t}","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/array.go#L197-L233","documentation":"A wrapper guard around arrayParseValue while scanning element text inside the '{...}' body: the element parser returned an error (e.g. unterminated quoted value), and it is re-wrapped as 'invalid array value'. The fault is in the element text, not the surrounding structure.","triggerScenarios":"Thrown at pgtype/array.go:215 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the wrapped error to find the offending element text","Fix quoting/escaping of element values (double quotes and backslashes must be escaped in quoted elements)","Re-encode the value via PostgreSQL or a pgx array encoder rather than hand-building the literal"],"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"}