Re: Set-returning function syntax

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Set-returning function syntax
Дата
Msg-id 3CE6EFF9.3000407@joeconway.com
обсуждение исходный текст
Ответ на Set-returning function syntax  ("Joel Burton" <joel@joelburton.com>)
Список pgsql-hackers
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





В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Set-returning function syntax
Следующее
От: Joe Conway
Дата:
Сообщение: Re: Set-returning function syntax