pgrx
pgrx copied to clipboard
RFC: Improved `HeapTuple` support
Right now we have basic support for HeapTuple, but we'd like to expand on it.
Currently these types are quite basic:
https://github.com/tcdi/pgx/blob/a96c1b75380cfda210029bc4671b342c4e904fe7/pgx/src/spi.rs#L69-L79
We'd like to be able to look up attributes via an ordinal index, or via attribute name.
This is partially to eventually support triggers (which OLD and NEW are heaptuples).
We'd like it for there to be a way to (without causing unnecessary copies) view the data inside these heaptuples, as well as bindings to their internal postgres counterparts which could mutate and/or create these heaptuples.
It may be that we need to distinct types, but we'd like to explore having one common type.
See #326
Yes, this would be very helpful. The zero-copy goal is also important. I would probably not use an implementation that merely copied a HeapTuple into a Map except in cases where performance did not matter.
This is in the develop-v0.5.0 branch