{"id":"eb708f3147dbbf54","repo":"jackc/pgx","slug":"too-many-fields","errorCode":null,"errorMessage":"too many fields","messagePattern":"too many fields","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pgproto3/row_description.go","lineNumber":107,"sourceCode":"\t\tfd.DataTypeSize = int16(binary.BigEndian.Uint16(src[rp:]))\n\t\trp += 2\n\t\tfd.TypeModifier = int32(binary.BigEndian.Uint32(src[rp:]))\n\t\trp += 4\n\t\tfd.Format = int16(binary.BigEndian.Uint16(src[rp:]))\n\t\trp += 2\n\n\t\tdst.Fields = append(dst.Fields, fd)\n\t}\n\n\treturn nil\n}\n\n// Encode encodes src into dst. dst will include the 1 byte message type identifier and the 4 byte message length.\nfunc (src *RowDescription) Encode(dst []byte) ([]byte, error) {\n\tdst, sp := beginMessage(dst, 'T')\n\n\tif len(src.Fields) > math.MaxUint16 {\n\t\treturn nil, errors.New(\"too many fields\")\n\t}\n\tdst = pgio.AppendUint16(dst, uint16(len(src.Fields)))\n\tfor _, fd := range src.Fields {\n\t\tdst = append(dst, fd.Name...)\n\t\tdst = append(dst, 0)\n\n\t\tdst = pgio.AppendUint32(dst, fd.TableOID)\n\t\tdst = pgio.AppendUint16(dst, fd.TableAttributeNumber)\n\t\tdst = pgio.AppendUint32(dst, fd.DataTypeOID)\n\t\tdst = pgio.AppendInt16(dst, fd.DataTypeSize)\n\t\tdst = pgio.AppendInt32(dst, fd.TypeModifier)\n\t\tdst = pgio.AppendInt16(dst, fd.Format)\n\t}\n\n\treturn finishMessage(dst, sp)\n}\n\n// MarshalJSON implements encoding/json.Marshaler.","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/pgproto3/row_description.go#L89-L125","documentation":"Error \"too many fields\" thrown in jackc/pgx.","triggerScenarios":"Thrown at pgproto3/row_description.go:107 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}