pgrx
pgrx copied to clipboard
`VARCHAR[]` cannot be extracted as Rust `Vec<String>`
When I check the is_compatible_with
function for String
, we also check VARCHAROID
. This way, we can map TEXT
+ VARCHAR
datums to Rust String
.
But it is not the case with VARCHAR[]
. I get non-binary coercible types
error when I try to extract Vec<String>
from VARCHAR[]
datum. I believe we lack a similar check at is_compatible_with
for Vec<T>
.
I wonder might my very naive approach below work out. It basically relies on if element types are compatible.
Looks like a related discussion. https://github.com/pgcentralfoundation/pgrx/issues/1361