Re: revised sample SRF C function; proposed SRF API

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Joe Conway <mail(at)joeconway(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: revised sample SRF C function; proposed SRF API
Date: 2002-06-09 01:00:39
Message-ID: 21865.1023584439@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Joe Conway <mail(at)joeconway(dot)com> writes:
> The question is how to best bootstrap this new function. In order to
> create the pg_proc entry I need the return type oid. If I understand
> correctly, in order to get a composite return type, with a known oid, I
> would need to create a bootstrapped relation and the corresponding
> bootstrapped pg_type entry.

Well, we're not doing that; and I see no good reason to make the thing
be a builtin function at all. Since it's just an example, it can very
well be a contrib item with a creation script. Probably *should* be,
in fact, because dynamically created functions are what other people are
going to be building; an example of how to do it as a builtin function
isn't as helpful.

Further down the road it may be that we'll get around to allowing
freestanding composite types (ie, ones with no associated table).
That would make it less painful to have builtin functions returning
tuples --- though not by a lot, since you'd still have to manufacture
pg_type and pg_attribute rows for 'em by hand. I'm not in a hurry to do
that in any case, because of the extent of restructuring of pg_class,
pg_type, and pg_attribute that would be needed.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2002-06-09 01:53:05 Re: Per tuple overhead, cmin, cmax, OID
Previous Message Marc G. Fournier 2002-06-09 00:10:43 Re: Per tuple overhead, cmin, cmax, OID

Browse pgsql-patches by date

  From Date Subject
Next Message Joe Conway 2002-06-09 02:32:04 Re: revised sample SRF C function; proposed SRF API
Previous Message Tom Lane 2002-06-08 23:45:48 Re: boolean options and postmaster documentation