Tatsuo Ishii wrote:
> Does your SRF function allow to return a setof composite data type
> using C function? If so, how can I write such that C function? I
> couldn't find any example or explanation so far. You referred dblink,
> but in my understanding it does not have any function that returns a
> setof composite data type.
>
I haven't written a C function yet that returns a composite type. You
are correct that dblink does not have an example which returns composite
type, because that wasn't even possible when I wrote the dblink code ;-)
At least initially, a C function returning a composite type will have to
do alot of dirty work -- i.e. something like:
- manually form a tuple based on the return type relation attributes
- save the tuple in a tuple table slot
- return a pointer to the slot as a datum
I don't know what other complications may be lurking, but I will try to
get a working example sometime this coming week and post it to HACKERS.
Joe