risingwavelabs/risingwave · error

unsupported type: {:?}

Error message

unsupported type: {:?}

What it means

The fallback arm of sea_type_to_pg_type: any SeaType that is not an Array or Unknown (enum-treatable) type has no PostgreSQL mapping, so the mapper bails. It indicates the source column type is not supported by the Postgres sink type mapper.

Source

Thrown at src/connector/src/connector_common/postgres.rs:854

                            PgKind::Enum(vec![]),
                            "".into(),
                        )),
                        "".into(),
                    ))
                }
                _ => bail!("unsupported array type: {:?}", t),
            }
        }
        SeaType::Unknown(name) => {
            // Treat as enum type
            Ok(PgType::new(
                name.clone(),
                0,
                PgKind::Enum(vec![]),
                "".into(),
            ))
        }
        _ => bail!("unsupported type: {:?}", sea_type),
    }
}

#[cfg(test)]
mod tests {
    use super::{
        format_grant_table_privilege, format_grant_usage, format_pg_table_name,
        format_required_table_grants, parse_pgvector_dimension,
    };

    #[test]
    fn test_parse_pgvector_dimension() {
        assert_eq!(parse_pgvector_dimension("vector(3)").unwrap(), Some(3));
        assert_eq!(parse_pgvector_dimension("VECTOR(768)").unwrap(), Some(768));
        assert_eq!(parse_pgvector_dimension("varchar").unwrap(), None);
    }

    #[test]

View on GitHub (pinned to 6469eb736d)

Solutions

  1. Change the column to a Postgres-supported type (numeric, text, timestamp, bool, bytea, etc.)
  2. Cast the column to a supported type in the sink query
  3. Upgrate RisingWave to a version that maps the type, or file an issue to add the mapping

Example fix

// before
col struct<a int>  -- unsupported for pg sink
// after
col jsonb  -- cast struct to jsonb
Defensive patterns

Strategy: validation

Validate before calling

fn pg_sink_compatible(t: &DataType) -> bool {
    !matches!(t, DataType::Struct(_) | DataType::List(_))
}
// validate every column of the sink target before CREATE SINK

Type guard

fn is_simple_type(t: &DataType) -> bool {
    !matches!(t, DataType::Struct(_) | DataType::List(_) | DataType::Map(_))
}

Prevention

When it happens

Trigger: Creating a Postgres sink where a column resolves to a SeaType variant with no mapping arm (e.g. unsupported struct/complex types) — type_mapping iterates columns and hits the terminal `_ => bail!`.

Common situations: Sinking tables containing unsupported complex column types (nested structs, unsupported temporal/custom types) to Postgres; upgrading RisingWave with new types whose sink mapping is missing.

Related errors


AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11). Data as JSON: /api/errors/846a6d44d54b9ab6. Report an issue: GitHub.