Re: Bug #933: Too many inserts crash server

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Bug #933: Too many inserts crash server
Дата
Msg-id 3936.1049441987@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Bug #933: Too many inserts crash server  (pgsql-bugs@postgresql.org)
Ответы Re: Bug #933: Too many inserts crash server
Список pgsql-bugs
pgsql-bugs@postgresql.org writes:
> If I create an external C function consisting of a
> simple loop that inserts 250000 records into a table
> the server process eventually crashes.

The memory leak goes away if you add

    SPI_freetuptable(SPI_tuptable);

after the SPI_exec() call.

I am not sure whether to consider this an SPI bug or not.  It's possibly
surprising that a non-SELECT query generates an empty tuple table; but
on the other hand, it's hard to say that no non-SELECT query can ever
generate a tuple table.  (EXPLAIN is a counterexample, for instance.)

It may be better to document that you should always do
SPI_freetuptable() no matter what kind of query you executed.

            regards, tom lane

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

Предыдущее
От: pgsql-bugs@postgresql.org
Дата:
Сообщение: Bug #933: Too many inserts crash server
Следующее
От: "Robert John Shepherd"
Дата:
Сообщение: Rapid deteriation of performance (might be caused by tsearch?) in 7.3.2