diff --git a/src/frontend/src/handler/create_table.rs b/src/frontend/src/handler/create_table.rs index d61df81551775..918570d73e7d5 100644 --- a/src/frontend/src/handler/create_table.rs +++ b/src/frontend/src/handler/create_table.rs @@ -1157,7 +1157,8 @@ async fn derive_schema_for_cdc_table( )) } else { let columns = bind_sql_columns(column_defs)?; - // retrieve primary key names from original table catalog if we can + // For table created by `create table t (*)` the constraint is empty, we need to + // retrieve primary key names from original table catalog if available let pk_names = if let Some(original_catalog) = original_catalog { original_catalog .pk