pgrx icon indicating copy to clipboard operation
pgrx copied to clipboard

`VARCHAR[]` cannot be extracted as Rust `Vec<String>`

Open aykut-bozkurt opened this issue 6 months ago • 12 comments

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.

image

Looks like a related discussion. https://github.com/pgcentralfoundation/pgrx/issues/1361

aykut-bozkurt avatar Aug 06 '24 16:08 aykut-bozkurt