Re: dblink memory leak

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: dblink memory leak
Дата
Msg-id 17818.1254711182@sss.pgh.pa.us
обсуждение исходный текст
Ответ на dblink memory leak  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Ответы Re: dblink memory leak  (Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp>)
Список pgsql-hackers
Itagaki Takahiro <itagaki.takahiro@oss.ntt.co.jp> writes:
> Joe Conway <mail@joeconway.com> wrote:
>> Please see if this works for you.

> It does not work because errors can occur in caller of dblink functions;
> Error callback should be still registered after SRF_RETURN_NEXT, so we
> cannot place callback context on stack of the function. More works needed.

Yeah, I meant to comment on that: it's an abuse of the error context
mechanism and will never be safe.  (An example is that if someone
innocently did an elog(LOG) or something like that, the callback would
get triggered.)  The global PGresult value seems awfully dangerous too.

I think what you want to do instead is use PG_TRY blocks to ensure that
transient results are cleaned up.
        regards, tom lane


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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Rules: A Modest Proposal
Следующее
От: Itagaki Takahiro
Дата:
Сообщение: Re: dblink memory leak