Re: Set-returning function syntax

From: Joe Conway <mail(at)joeconway(dot)com>
To: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
Cc: joel(at)joelburton(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Set-returning function syntax
Date: 2002-05-19 00:21:13
Message-ID: 3CE6EFF9.3000407@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message C. Maj 2002-05-19 00:37:11 Re: [HACKERS] libpgtcl - backend version information
Previous Message Tom Lane 2002-05-19 00:17:48 Re: Set-returning function syntax