Nested SPI_exec's

Поиск
Список
Период
Сортировка
Искать
От
Jason Godden
Тема
Nested SPI_exec's
Дата
Msg-id
200310061830.34357.jasongodden@optushome.com.au
Список
Дерево обсуждения
Nested SPI_exec's Jason Godden <jasongodden@optushome.com.au>
Re: Nested SPI_exec's Tom Lane <tgl@sss.pgh.pa.us>
Re: Nested SPI_exec's Jason Godden <jasongodden@optushome.com.au>
Hi All,

I'm in the process of moving a rather complicated plpgsql stored procedure to 
a C module and I'm curious about how to implement the for each row syntax in 
C.  My understanding is that if you perform an SPI_exec whilst looping 
through the results of another exec the allocated SPITupleTable will be 
automatically unallocated.  Is this correct or am I way off here and it's 
actually safe to iterate through the tuples in an SPITupleTable and perform 
additional SPI_exec's?  Thinking about this now it probably is but I thought 
it better to ask.

The other query I have relates to the transaction 'safe-ness' of a C module. 
If I initiate all of this within a transaction (from outside the C module), 
is everything within the SPI module automagically encapsulated with the 
transaction or do I have to manage the transaction from within the SPI 
module?

Rgds,

Jason
В списке pgsql-general по дате отправления
От: Pavel Stehule
Дата:
От: CSN
Дата:
Сообщение: orphaned psql's
FAQ