SPI question...
От | Scott Muir |
---|---|
Тема | SPI question... |
Дата | |
Msg-id | 000201c06480$999f0160$0a00a8c0@lan обсуждение исходный текст |
Список | pgsql-interfaces |
I'm working on a module which uses the SPI... I'm not making sense of the docs for this... Where I differ from the example in the Programmers dox, is I'm wanting to pull together information from more than one table in my db. In the documentation, the algorithm section for "SPI_exec" seems to have the text as in the same section for "SPI_finish"... Anyways, if someone could clarify for me, 1) if more than one query plan is executed, are the result tupletables available at the same time, or are the tupletables overwritten each time a plan is executed? Is there a way of protecting the results? 2) if the tupletables do stack up, how does one explicitly dispose of them? Re: memory management.. as I understand it the difference between upper and context memory: upper is like global or static memory, remains intact; context is scoped to the C function it was constructed in, and is automatically disposed of when the context is disposed of. I am a novice C programmer and am pretty much learning C as a useful side-effect of implementing this solution. so: 3) is the context referring to anything going on inside the connection? or are we talking when a C function containing the declarations for TupleDesc and SPITupleTable returns and discards its local variables? Thank you, Scott..
В списке pgsql-interfaces по дате отправления: