{"record":{"id":"b7ba4f426e8a4808","repo":"risingwavelabs/risingwave","slug":"unsupported-postgresql-snapshot-data-type-data-ty","errorCode":null,"errorMessage":"unsupported PostgreSQL snapshot data type {data_type} for column `{name}`","messagePattern":"unsupported PostgreSQL snapshot data type (.+?) for column `(.+?)`","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/connector/src/parser/postgres.rs","lineNumber":221,"sourceCode":"                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}`\")\n        }\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use tokio_postgres::NoTls;\n\n    use crate::parser::postgres::PgVectorAdapter;\n    use crate::parser::scalar_adapter::EnumString;\n    const DB: &str = \"postgres\";\n    const USER: &str = \"kexiang\";\n\n    #[test]\n    fn test_pg_vector_adapter_parse_binary() {\n        let mut raw = vec![];\n        // dim = 3\n        raw.extend_from_slice(&(3u16.to_be_bytes()));","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/connector/src/parser/postgres.rs#L203-L239","documentation":"Raised when the target RisingWave column type is Serial, Map, or Variant, none of which can be decoded from a PostgreSQL snapshot by this converter. The bail happens in the catch-all arm before any cell decode. These RW types have no defined Postgres snapshot representation in the connector.","triggerScenarios":"`postgres_cell_to_scalar_impl_strict` falls through to `DataType::Serial | DataType::Map(_) | DataType::Variant` during snapshot reads (`postgres_row_to_owned_row_with_strict_pk`, `min_and_max`, `next_split_right_bound_exclusive`, `next_greater_bound`).","commonSituations":"RW table created with a Map/Variant column over a Postgres source (e.g. JSON/JSONB mapped to Variant); schema inference produced Serial or Map from a Postgres type; snapshots of tables whose inferred schema includes these unsupported types.","solutions":["Change the RW column type to a supported one — e.g. map Postgres JSON/JSONB to varchar instead of Variant.","Recreate the RW table without Serial/Map/Variant columns for Postgres CDC snapshots.","Cast unsupported Postgres columns to text in the source and declare them as varchar in RW.","Upgrade RisingWave in case newer versions support the type for Postgres snapshots."],"exampleFix":"-- before\nCREATE TABLE t (attrs map<varchar, varchar>) FROM pg ...;\n-- after: read JSON as text\nCREATE TABLE t (attrs varchar) FROM pg ...;","handlingStrategy":"validation","validationCode":"fn unsupported_for_pg_snapshot(dt: &DataType) -> bool {\n    matches!(dt, DataType::Serial | DataType::Map(_) | DataType::Variant)\n}","typeGuard":"fn unsupported_for_pg_snapshot(dt: &DataType) -> bool {\n    matches!(dt, DataType::Serial | DataType::Map(_) | DataType::Variant)\n}","tryCatchPattern":"match result {\n    Err(e) if e.to_string().contains(\"unsupported PostgreSQL snapshot data type\") => {\n        // change column to varchar (JSON as text) and recreate the table\n    }\n    other => other?,\n}","preventionTips":["Never declare Serial/Map/Variant columns for PG CDC snapshot tables.","Map PG JSON/JSONB to varchar in RW schemas.","Review inferred schemas before starting ingestion and drop unsupported columns."],"tags":["postgres","cdc","unsupported-type","schema"],"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"}