Re: SPI_finish and RegisterExprContextCallback

Поиск
Список
Период
Сортировка
От Thomas Hallgren
Тема Re: SPI_finish and RegisterExprContextCallback
Дата
Msg-id thhal-0O7fxAmWlxic3a2eD4mr6vuqtSwG+mi@mailblocks.com
обсуждение исходный текст
Ответ на Re: SPI_finish and RegisterExprContextCallback  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Tom,

>You're right, you can't just return from that inner function while
>leaving its SPI connection open.
>
>It might be interesting to redesign SPI around the notion of independent
>"connection objects" rather than necessarily having a stack of 'em.
>  
>
I made the same reflection looking at the SPI code. It would be nice if 
something corresponding to _SPI_current could be passed around.

>I think that could be made to work ... but not while preserving the
>existing SPI API.
>
I'm not so sure you'd have to. A public API that can disable stack 
handling and instead use something similar to MemoryContextSwitchTo but 
for an _SPI_current like structure would perhaps be sufficient?

>  I'm hesitant to break a ton of user-written code for
>a feature that only one person has needed :-(
>  
>
It is a fairly serious design flaw IMHO. I discovered it and so far no 
one else has complained. That's true for all flaws at first.

Regards,
Thomas Hallgren




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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: SPI_finish and RegisterExprContextCallback
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Data loss, vacuum, transaction wrap-around