Re: more psprintf() use

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: more psprintf() use
Дата
Msg-id 52C9BFD5.6080903@gmx.net
обсуждение исходный текст
Ответ на Re: more psprintf() use  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: more psprintf() use  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 1/2/14, 9:28 AM, Tom Lane wrote:
> Heikki is right and you are wrong.  There is an ancient supposition that
> datatype output functions, in particular, always return palloc'd strings.
> 
> I recently got rid of the pfree's in the main output path, cf commit
> b006f4ddb988568081f8290fac77f9402b137120, which might explain why this
> patch passes regression tests; but there are still places in the code (and
> even more likely in third-party code) that will try to pfree the results.

Well, that seems kind of dangerous.  The next guys is going to write an
extension that is returning string constants directly, and there is no
straightforward way to detect this problem.  Perhaps we should have some
mode similar to the CLOBBER and COPY_*_TREES symbols to force a pfree()
in assertion-enabled builds?





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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: [PATCH] SQL assertions prototype
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: more psprintf() use