risingwavelabs/risingwave · error
unsupported PostgreSQL snapshot data type {data_type} for co
Error message
unsupported PostgreSQL snapshot data type {data_type} for column `{name}` What it means
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.
Source
Thrown at src/connector/src/parser/postgres.rs:221
bail!("unsupported PostgreSQL snapshot list element type {elem}")
}
_ => {
match row
.try_get::<_, Option<ScalarAdapter>>(i)
.with_context(|| {
format!("failed to decode PostgreSQL snapshot list column `{name}`")
})? {
Some(value) => value.into_scalar(data_type).map(Some).ok_or_else(|| {
anyhow!(
"failed to convert PostgreSQL snapshot column `{name}` to {data_type}"
)
}),
None => Ok(None),
}
}
},
DataType::Serial | DataType::Map(_) | DataType::Variant => {
bail!("unsupported PostgreSQL snapshot data type {data_type} for column `{name}`")
}
}
}
#[cfg(test)]
mod tests {
use tokio_postgres::NoTls;
use crate::parser::postgres::PgVectorAdapter;
use crate::parser::scalar_adapter::EnumString;
const DB: &str = "postgres";
const USER: &str = "kexiang";
#[test]
fn test_pg_vector_adapter_parse_binary() {
let mut raw = vec![];
// dim = 3
raw.extend_from_slice(&(3u16.to_be_bytes()));View on GitHub (pinned to 6469eb736d)
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.
Example fix
-- before CREATE TABLE t (attrs map<varchar, varchar>) FROM pg ...; -- after: read JSON as text CREATE TABLE t (attrs varchar) FROM pg ...;
Defensive patterns
Strategy: validation
Validate before calling
fn unsupported_for_pg_snapshot(dt: &DataType) -> bool {
matches!(dt, DataType::Serial | DataType::Map(_) | DataType::Variant)
} Type guard
fn unsupported_for_pg_snapshot(dt: &DataType) -> bool {
matches!(dt, DataType::Serial | DataType::Map(_) | DataType::Variant)
} Try / catch
match result {
Err(e) if e.to_string().contains("unsupported PostgreSQL snapshot data type") => {
// change column to varchar (JSON as text) and recreate the table
}
other => other?,
} Prevention
- 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.
When it happens
Trigger: `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`).
Common situations: 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.
Related errors
- unsupported postgres type: {}
- Postgres table should define the primary key for non-append-
- {:?} data type is not supported
- unsupported data type: {}, set to null
- unsupported PostgreSQL snapshot list element type {elem}
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/b7ba4f426e8a4808.
Report an issue: GitHub.