Why does SPI_connect change the memory context?

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Why does SPI_connect change the memory context?
Дата
Msg-id b715a1eadb4909a7d892c971631391fa95ea63ab.camel@j-davis.com
обсуждение исходный текст
Ответы Re: Why does SPI_connect change the memory context?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
SPI_connect() changes the memory context to a newly-created one, and
then SPI_finish() restores it. That seems a bit dangerous because the
caller might not be expecting it. Is there a reason it doesn't just
change to the new memory context as-needed?

spi.c:161:

   /* ... and switch to procedure's context */
    _SPI_current->savedcxt = MemoryContextSwitchTo(_SPI_current-
>procCxt);

Regards,
    Jeff Davis





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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] Runtime Partition Pruning
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Names