Re: revised sample SRF C function; proposed SRF API

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: revised sample SRF C function; proposed SRF API
Дата
Msg-id 21865.1023584439@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: revised sample SRF C function; proposed SRF API  (Joe Conway <mail@joeconway.com>)
Список pgsql-hackers
Joe Conway <mail@joeconway.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


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

Предыдущее
От: "Marc G. Fournier"
Дата:
Сообщение: Re: Per tuple overhead, cmin, cmax, OID
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: Per tuple overhead, cmin, cmax, OID