diff --git a/README.md b/README.md index 571d56f1..846ce0c9 100644 --- a/README.md +++ b/README.md @@ -133,6 +133,7 @@ cargo pgx test --features all_fdws,pg15 - Windows is not supported, that limitation inherits from [pgx](https://github.com/tcdi/pgx). - Currently only supports PostgreSQL v14 and v15. +- Generated column is not supported. ## Contribution diff --git a/supabase-wrappers/README.md b/supabase-wrappers/README.md index 950ce1f8..3872b850 100644 --- a/supabase-wrappers/README.md +++ b/supabase-wrappers/README.md @@ -130,6 +130,7 @@ wrappers=# select * from hello; - Windows is not supported, that limitation inherits from [pgx](https://github.com/tcdi/pgx). - Currently only supports PostgreSQL v14 and v15. +- Generated column is not supported. ## Contribution diff --git a/supabase-wrappers/src/utils.rs b/supabase-wrappers/src/utils.rs index 7e17219e..dea71ab2 100644 --- a/supabase-wrappers/src/utils.rs +++ b/supabase-wrappers/src/utils.rs @@ -263,6 +263,12 @@ pub(super) unsafe fn extract_target_columns( let attno = (*var).varattno; let attname = pg_sys::get_attname((*rte).relid, attno, true); if !attname.is_null() { + // generated column is not supported + if pg_sys::get_attgenerated((*rte).relid, attno) > 0 { + report_warning("generated column is not supported"); + continue; + } + let type_oid = pg_sys::get_atttype((*rte).relid, attno); ret.push(Column { name: CStr::from_ptr(attname).to_str().unwrap().to_owned(),