1SPI_FREETUPTABLE(3) PostgreSQL 13.3 Documentation SPI_FREETUPTABLE(3)
2
3
4
6 SPI_freetuptable - free a row set created by SPI_execute or a similar
7 function
8
10 void SPI_freetuptable(SPITupleTable * tuptable)
11
13 SPI_freetuptable frees a row set created by a prior SPI command
14 execution function, such as SPI_execute. Therefore, this function is
15 often called with the global variable SPI_tuptable as argument.
16
17 This function is useful if an SPI-using C function needs to execute
18 multiple commands and does not want to keep the results of earlier
19 commands around until it ends. Note that any unfreed row sets will be
20 freed anyway at SPI_finish. Also, if a subtransaction is started and
21 then aborted within execution of an SPI-using C function, SPI
22 automatically frees any row sets created while the subtransaction was
23 running.
24
25 Beginning in PostgreSQL 9.3, SPI_freetuptable contains guard logic to
26 protect against duplicate deletion requests for the same row set. In
27 previous releases, duplicate deletions would lead to crashes.
28
30 SPITupleTable * tuptable
31 pointer to row set to free, or NULL to do nothing
32
33
34
35PostgreSQL 13.3 2021 SPI_FREETUPTABLE(3)