{"id":"6d837c40c0c0d9cc","repo":"jackc/pgx","slug":"range-element-oid-v-was-not-already-registered-n","errorCode":null,"errorMessage":"Range element OID %v was not already registered, needed for %q","messagePattern":"Range element OID (.+?) was not already registered, needed for %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"derived_types.go","lineNumber":222,"sourceCode":"\t\t\t\t\treturn nil, fmt.Errorf(\"Unknown field for composite type %q:  field %q (OID %v) is not already registered.\", ti.TypeName, fieldName, ti.Atttypids[i])\n\t\t\t\t}\n\t\t\t\tfields = append(fields, pgtype.CompositeCodecField{Name: fieldName, Type: dt})\n\t\t\t}\n\n\t\t\ttype_ = &pgtype.Type{Name: ti.TypeName, OID: ti.Oid, Codec: &pgtype.CompositeCodec{Fields: fields}}\n\t\tcase \"d\": // domain\n\t\t\tdt, ok := m.TypeForOID(ti.Typbasetype)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"Domain base type OID %v was not already registered, needed for %q\", ti.Typbasetype, ti.TypeName)\n\t\t\t}\n\n\t\t\ttype_ = &pgtype.Type{Name: ti.TypeName, OID: ti.Oid, Codec: dt.Codec}\n\t\tcase \"e\": // enum\n\t\t\ttype_ = &pgtype.Type{Name: ti.TypeName, OID: ti.Oid, Codec: &pgtype.EnumCodec{}}\n\t\tcase \"r\": // range\n\t\t\tdt, ok := m.TypeForOID(ti.Rngsubtype)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"Range element OID %v was not already registered, needed for %q\", ti.Rngsubtype, ti.TypeName)\n\t\t\t}\n\n\t\t\ttype_ = &pgtype.Type{Name: ti.TypeName, OID: ti.Oid, Codec: &pgtype.RangeCodec{ElementType: dt}}\n\t\tcase \"m\": // multirange\n\t\t\tdt, ok := m.TypeForOID(ti.Rngtypid)\n\t\t\tif !ok {\n\t\t\t\treturn nil, fmt.Errorf(\"Multirange element OID %v was not already registered, needed for %q\", ti.Rngtypid, ti.TypeName)\n\t\t\t}\n\n\t\t\ttype_ = &pgtype.Type{Name: ti.TypeName, OID: ti.Oid, Codec: &pgtype.MultirangeCodec{ElementType: dt}}\n\t\tdefault:\n\t\t\treturn nil, fmt.Errorf(\"Unknown typtype %q was found while registering %q\", ti.Typtype, ti.TypeName)\n\t\t}\n\n\t\t// the type_ is impossible to be null\n\t\tm.RegisterType(type_)\n\t\tif ti.NspName != \"\" {\n\t\t\tnspType := &pgtype.Type{Name: ti.NspName + \".\" + type_.Name, OID: type_.OID, Codec: type_.Codec}","sourceCodeStart":204,"sourceCodeEnd":240,"githubUrl":"https://github.com/jackc/pgx/blob/ec1a0befd22592cffffdeeb0a50311b506372f4c/derived_types.go#L204-L240","documentation":"Error \"Range element OID %v was not already registered, needed for %q\" thrown in jackc/pgx.","triggerScenarios":"Thrown at derived_types.go:222 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}