Re: Returning tuple(s) from C-Functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Poten <philip(dot)poten(at)linuxteam(dot)at>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Returning tuple(s) from C-Functions
Date: 2001-04-30 05:31:59
Message-ID: 10831.988608719@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Philip Poten <philip(dot)poten(at)linuxteam(dot)at> writes:
> This is what the FAQ says about it:

> 5.3) How do I write a C function to return a tuple?

> This requires wizardry so extreme that the authors have never tried it,
> though in principle it can be done?

> Is this answer still correct? Is there a way to do it with 7.1?

It's not so much that the wizardry is extreme as that once you've done
it, the resulting function is not all that useful, because there's not
very much you can *do* with a function returning tuples. You might
care to experiment with SQL functions that return tuples to see whether
the system will support what you need to do, before you spend a lot of
effort on replicating their behavior.

In case that wasn't a clear enough hint: to do it, lift appropriate
code from SQL function execution (backend/executor/functions.c).

Be aware that this interface will likely be redesigned whenever we
get around to allowing functions as table sources, which is exactly
the step needed to make such things more conveniently usable. Might
happen for 7.2 ...

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-04-30 05:39:45 Re: PostgreSQL and mySQL database size question
Previous Message Alfred Perlstein 2001-04-30 05:29:08 Postgresql CVSup server down?