Closed mstrydom closed 1 year ago
https://docs.rs/postgres_array/latest/postgres_array/ provides more control over array types.
Though we could (and probably should) update that ToSql impl to use a lower_bound of 0 when the target type is oidvector.
https://docs.rs/postgres_array/latest/postgres_array/ provides more control over array types.
I will take a look at that and see if it solves the problem. Thanks!
I can confirm that postgres_array
does solve my problem, thanks! I did have to muck around with some extra formatting/to_string conversions to get it to format the same in Rust as in Postgres, so I still think having an explicit oidvector
type might be nice. But feel free to resolve this issue if you do not agree that more work is warranted here.
postgres-types
does not seem to have built in support foroidvector
. I tried to do this by insertingvec![1_u32, 2_u32]
as aVec<Oid>
, but doing so results in:Which seems to come from this line in the Postgres codebase. It looks to me like Postgres assumes a lower_bound of 0, but
ToSql
ofVec
is always setting it as 1.Is there another way to send in
oidvector
as a bound parameter?