Re: Returning tuple(s) from C-Functions - Mailing list pgsql-general

From Tom Lane
Subject Re: Returning tuple(s) from C-Functions
Date
Msg-id 10831.988608719@sss.pgh.pa.us
Whole thread Raw
In response to Returning tuple(s) from C-Functions  (Philip Poten <philip.poten@linuxteam.at>)
List pgsql-general
Philip Poten <philip.poten@linuxteam.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

pgsql-general by date:

Previous
From: Alfred Perlstein
Date:
Subject: Postgresql CVSup server down?
Next
From: Tom Lane
Date:
Subject: Re: PostgreSQL and mySQL database size question