{"record":{"id":"84a695e0bd062202","repo":"risingwavelabs/risingwave","slug":"unsupported-postgresql-snapshot-list-element-type","errorCode":null,"errorMessage":"unsupported PostgreSQL snapshot list element type {elem}","messagePattern":"unsupported PostgreSQL snapshot list element type (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/parser/postgres.rs","lineNumber":203,"sourceCode":"                        .into_iter()\n                        .map(Finite32::try_from)\n                        .collect::<Result<Vec<_>, _>>()\n                        .map_err(anyhow::Error::msg)\n                        .with_context(|| {\n                            format!(\n                                \"PostgreSQL snapshot column `{name}` contains a non-finite vector \\\n                                 element\"\n                            )\n                        })?;\n                    Ok(Some(ScalarImpl::Vector(VectorVal::from(finite))))\n                }\n                None => Ok(None),\n            }\n        }\n        DataType::List(list) => match list.elem() {\n            // TODO(Kexiang): allow DataType::List(_)\n            elem @ (DataType::Struct(_) | DataType::List(_) | DataType::Serial) => {\n                bail!(\"unsupported PostgreSQL snapshot list element type {elem}\")\n            }\n            _ => {\n                match row\n                    .try_get::<_, Option<ScalarAdapter>>(i)\n                    .with_context(|| {\n                        format!(\"failed to decode PostgreSQL snapshot list column `{name}`\")\n                    })? {\n                    Some(value) => value.into_scalar(data_type).map(Some).ok_or_else(|| {\n                        anyhow!(\n                            \"failed to convert PostgreSQL snapshot column `{name}` to {data_type}\"\n                        )\n                    }),\n                    None => Ok(None),\n                }\n            }\n        },\n        DataType::Serial | DataType::Map(_) | DataType::Variant => {\n            bail!(\"unsupported PostgreSQL snapshot data type {data_type} for column `{name}`\")","sourceCodeStart":185,"sourceCodeEnd":221,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/parser/postgres.rs#L185-L221","documentation":"Raised when the element type of a RisingWave List column is Struct, a nested List, or Serial, which the PostgreSQL snapshot reader does not support decoding. The converter bails before attempting to read the cell; nested list support is an explicit TODO in the connector.","triggerScenarios":"`postgres_cell_to_scalar_impl_strict` matches a `DataType::List` column whose `elem()` is `Struct(_)`, `List(_)`, or `Serial` during snapshot reads (`postgres_row_to_owned_row_with_strict_pk` and the split-bound helpers).","commonSituations":"Creating an RW table over Postgres with `array<struct<...>>`, `array<array<...>>`, or `array<serial>` columns; schema inference mapping a Postgres composite array to a struct list; upstream type changed after the table was created.","solutions":["Flatten the schema: replace the nested list/struct-list column with a supported element type or model the nesting as a separate table/JSON.","Re-create the RW table with a supported list element type (scalars, enums).","Cast the Postgres column to text/JSON in the source query and read it as a varchar/JSON column.","Upgrade to a version with nested-list support or track the TODO in the connector."],"exampleFix":"// before\nCREATE TABLE t (rows array<struct<a int>>) FROM pg ...;\n// after: supported scalar element type\nCREATE TABLE t (rows array<int>) FROM pg ...;","handlingStrategy":"validation","validationCode":"// Before creating the table, verify list element types are supported:\n// RW list elem must not be Struct, List, or Serial for PG snapshot reads.\nfn has_unsupported_list_elem(dt: &DataType) -> bool {\n    matches!(dt, DataType::List(l) if matches!(\n        l.elem(), DataType::Struct(_) | DataType::List(_) | DataType::Serial))\n}","typeGuard":"fn has_unsupported_list_elem(dt: &DataType) -> bool {\n    matches!(dt, DataType::List(l) if matches!(\n        l.elem(), DataType::Struct(_) | DataType::List(_) | DataType::Serial))\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"unsupported PostgreSQL snapshot list element type\") => {\n        // recreate table with a supported element type or model as JSON\n    }\n    other => other?,\n}","preventionTips":["Never declare array<struct>, array<array>, or array<serial> columns on PG CDC sources.","Check schema DDL against connector-supported types before table creation.","Model nested structures as JSON/varchar columns instead."],"tags":["postgres","cdc","unsupported-type","nested-list"],"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-14T16:17:12.679Z"}