Closed eeeebbbbrrrr closed 1 year ago
well, would ya look at that: https://github.com/tcdi/pgrx/pull/1117
This got taken care of as part of https://github.com/tcdi/plrust/pull/297
[v14.7][1841693] plrust=# create function sum_array(a numeric[]) returns numeric strict language plrust as $$ Ok(Some(a.into_iter().map(|e| e.unwrap()).sum()))
$$;
CREATE FUNCTION
[v14.7][1841693] plrust=# select sum_array(ARRAY[1, 2.0, 3.5]);
sum_array
-----------
6.5
(1 row)
It would be nice if pgrx implemented
impl std::iter::Sum
-- would make AnyNumeric easier to use here in plrust land.