Re: Must a C state transition function use palloc on the returned value?

Поиск
Список
Период
Сортировка
От Dirk Lutzebaeck
Тема Re: Must a C state transition function use palloc on the returned value?
Дата
Msg-id 14860.4233.534788.378482@ampato.core.aeccom.com
обсуждение исходный текст
Ответ на Re: Must a C state transition function use palloc on the returned value?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom Lane writes:> Dirk Lutzebaeck <lutzeb@aeccom.com> writes:> > I'm defining a new aggregate using a C transition
function.It is of> > type TEXT, so the C function gets pointers (*text) to the internal-state1 and> > next-data-item
parameters.> > > Question is if the returning value of type *text must be palloc'ed or> > can be just taken from the
inputparameters.> > The result must be a fresh palloc, since both inputs will be pfreed the> moment you return.  7.1
willcopy the result for you if you are so> incautious as to try to return an input, but 7.0.* just falls over :-(
 

Thanks! It works now...

Dirk



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Must a C state transition function use palloc on the returned value?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Unhappy thoughts about pg_dump and objects inherited from template1