Re: [bug fix] Memory leak in dblink

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [bug fix] Memory leak in dblink
Дата
Msg-id 11929.1403147997@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [bug fix] Memory leak in dblink  (Joe Conway <mail@joeconway.com>)
Ответы Re: [bug fix] Memory leak in dblink
Список pgsql-hackers
Joe Conway <mail@joeconway.com> writes:
> On a side note, while perusing this section of code:

> 8<-------------------------- at dblink.c:1176 --------------------------
>  /* make sure we have a persistent copy of the tupdesc */
>  tupdesc = CreateTupleDescCopy(tupdesc);

> Shouldn't that CreateTupleDescCopy() happen in ecxt_per_query_memory?

Not necessary (we'd have seen crashes long since if it was).
ExecMakeTableFunctionResult doesn't need the tupdesc to persist past
return.

Actually, I was wondering whether we couldn't remove that
CreateTupleDescCopy call entirely.  The risk would be if
get_call_result_type returned a pointer into relcache or some other cached
tuple descriptor, which might be subject to a cache flush --- but AFAICS
it always returns a freshly created or copied tupdesc.  (This might not
have been true originally, which could explain why dblink thinks it needs
to copy.)
        regards, tom lane



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

Предыдущее
От: Ian Barwick
Дата:
Сообщение: Re: Possible index issue on 9.5 slave
Следующее
От: Peter Geoghegan
Дата:
Сообщение: Re: Possible index issue on 9.5 slave