pgcentralfoundation / pgrx

Build Postgres Extensions with Rust!
Other
3.42k stars 223 forks source link

return u32 error #1698

Open FreeGIS opened 1 month ago

FreeGIS commented 1 month ago

[pg_extern]

fn get_u32() -> u32 { let a: u32 = 2; a }

Error: 0: Could not write SQL to /home/postgres/pg16/share/extension/postgrid--0.0.0.sql 1: Got non-plain mapped/composite return variant SQL in what macro-expansion thought was a type, got: One(Source { array_brackets: false })

Location: /root/.cargo/registry/src/rsproxy.cn-8f6827c7555bfaf8/pgrx-sql-entity-graph-0.11.4/src/pg_extern/entity/mod.rs:273

ccleve commented 6 days ago

This one has bitten me more than once. Must use i32.

t3hmrman commented 4 days ago

Maybe it makes sense to add some checking for this to pg_extern itself? That might save people who run into this in the future