{"record":{"id":"a73c37a116319185","repo":"jackc/pgx","slug":"invalid-array-expected-got-v","errorCode":null,"errorMessage":"invalid array, expected ':' got %v","messagePattern":"invalid array, expected ':' got (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgtype/array.go","lineNumber":143,"sourceCode":"\n\t\t\tif r == '=' {\n\t\t\t\tbreak\n\t\t\t} else if r != '[' {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid array, expected '[' or '=' got %v\", r)\n\t\t\t}\n\n\t\t\tlower, err := arrayParseInteger(buf)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid array: %w\", err)\n\t\t\t}\n\n\t\t\tr, _, err = buf.ReadRune()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid array: %w\", err)\n\t\t\t}\n\n\t\t\tif r != ':' {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid array, expected ':' got %v\", r)\n\t\t\t}\n\n\t\t\tupper, err := arrayParseInteger(buf)\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid array: %w\", err)\n\t\t\t}\n\n\t\t\tr, _, err = buf.ReadRune()\n\t\t\tif err != nil {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid array: %w\", err)\n\t\t\t}\n\n\t\t\tif r != ']' {\n\t\t\t\treturn nil, fmt.Errorf(\"invalid array, expected ']' got %v\", r)\n\t\t\t}\n\n\t\t\texplicitDimensions = append(explicitDimensions, ArrayDimension{LowerBound: lower, Length: upper - lower + 1})\n\t\t}","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgtype/array.go#L125-L161","documentation":"parseUntypedTextArray read a dimension's lower bound but the next rune was not ':'. PostgreSQL text arrays with explicit dimensions require '[lower:upper]' pairs, so a missing colon or a non-numeric lower bound that stopped early triggers this.","triggerScenarios":"Thrown at pgtype/array.go:143 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the dimension syntax to '[lower:upper]' (colon required) for every dimension in the prefix","Remove the explicit-dimension prefix and rely on the implicit '{...}' form","Sanitize generated SQL/text that builds array literals"],"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"}