Trying to formulate a good strategy for $subject. The code is
performance critical.
The composite type is simple: (text, text), that needs to be routed to
function call in array form. The #elements in the array is small,
generally less than 10.
The approach I have now is this:
1) look up the oid for the composite and prepare tupledesc:
1a) TypeGetTupleDesc
2b) BlessTupleDesc
2) build the composite via:
2a) TupleDescGetAttInMetadata
2b) BuildTupleFromCStrings
2c) get datum/HeapTupleGetDatum
3) repeat to 2 until I have a Datum for each tuple
4) construct_array(datums, ndatums, comp_oid, -1, false, false)
5) PointerGetDatum directly on the ArrayType to get the oid to pass to SPI_execp
Does this look reasonable?
merlin