{"record":{"id":"55416592f77e43ae","repo":"risingwavelabs/risingwave","slug":"unsupported-oid-0","errorCode":null,"errorMessage":"Unsupported oid {0}","messagePattern":"Unsupported oid (.+?)","errorType":"validation","errorClass":"UnsupportedOid","httpStatus":null,"severity":"error","filePath":"src/common/src/types/postgres_type.rs","lineNumber":55,"sourceCode":"            { Int16       |   21 |     1005 | int2        | int2in         |      2 }\n            { Int32       |   23 |     1007 | int4        | int4in         |      4 }\n            { Float32     |  700 |     1021 | float4      | float4in       |      4 }\n            { Float64     |  701 |     1022 | float8      | float8in       |      8 }\n            { Varchar     | 1043 |     1015 | varchar     | varcharin      |     -1 }\n            { Date        | 1082 |     1182 | date        | date_in        |      4 }\n            { Time        | 1083 |     1183 | time        | time_in        |      8 }\n            { Timestamp   | 1114 |     1115 | timestamp   | timestamp_in   |      8 }\n            { Timestamptz | 1184 |     1185 | timestamptz | timestamptz_in |      8 }\n            { Interval    | 1186 |     1187 | interval    | interval_in    |     16 }\n            { Decimal     | 1700 |     1231 | numeric     | numeric_in     |     -1 }\n            { Jsonb       | 3802 |     3807 | jsonb       | jsonb_in       |     -1 }\n            { Variant     | 1307 |     1308 | variant     | variant_in     |     -1 }\n        }\n    };\n}\n\n#[derive(Debug, thiserror::Error)]\n#[error(\"Unsupported oid {0}\")]\npub struct UnsupportedOid(i32);\n\n/// Get type information compatible with Postgres type, such as oid, type length.\nimpl DataType {\n    /// For a fixed-size type, typlen is the number of bytes in the internal representation of the type.\n    /// But for a variable-length type, typlen is negative.\n    /// -1 indicates a “varlena” type (one that has a length word),\n    /// -2 indicates a null-terminated C string.\n    ///\n    /// <https://www.postgresql.org/docs/15/catalog-pg-type.html#:~:text=of%20the%20type-,typlen,-int2>\n    pub fn type_len(&self) -> i16 {\n        macro_rules! impl_type_len {\n            ($( { $enum:ident | $oid:literal | $oid_array:literal | $name:ident | $input:ident | $len:literal } )*) => {\n                match self {\n                    $(\n                    DataType::$enum => $len,\n                    )*\n                    DataType::Serial => 8,","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/common/src/types/postgres_type.rs#L37-L73","documentation":"UnsupportedOid is a thiserror error thrown when the Postgres-compatible type lookup encounters an OID it has no mapping for. The postgres_type module maps RisingWave DataType to Postgres type OIDs (typlen, typmod, etc.); unknown OIDs cannot be translated.","triggerScenarios":"Calling `DataType::to_pg_oid` / from_oid-style conversions (or whatever builds the static OID table at src/common/src/types/postgres_type.rs) with an OID integer outside the macro-generated table, e.g. array/variant OIDs from newer extensions.","commonSituations":"A pgwire client requesting type info for an OID RisingWave does not support (custom types, extensions like PostGIS), or decoding a RowDescription from a real Postgres with exotic types.","solutions":["Check the OID against the supported list in postgres_type.rs and use a supported type","Map the unknown OID to text/bytea as a fallback before conversion","Extend the macro table with the new OID if you control the schema"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"fn oid_supported(oid: i32) -> bool {\n    matches!(oid, 16 | 17 | 18 | 19 | 20 | 21 | 23 | 25 | 26 | 700 | 701 | 1042 | 1043 | 1082 | 1114 | 1184 | 1700)\n}","typeGuard":null,"tryCatchPattern":"match DataType::from_pg_oid(oid) {\n    Ok(dt) => dt,\n    Err(UnsupportedOid(o)) => DataType::Varchar, // fallback mapping\n}","preventionTips":["Keep a fallback mapping of unknown OIDs to text/bytea","Log unsupported OIDs to extend the table later","Check the supported OID list in postgres_type.rs before adding new client types"],"tags":["rust","postgres","oid","pgwire"],"backgroundTag":"unsupported-enum-value","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}