The structure SPITupleTable is defined
thus:
-typedef struct
+typedef struct SPITupleTable
{
+ /* Public members */
+ TupleDesc tupdesc; /* tuple descriptor */
+ HeapTuple *vals; /* array of tuples */
+
+ /* Private members, not intended for external callers */
MemoryContext tuptabcxt; /* memory context of result table */
- uint64 alloced; /* number of alloced vals */
- uint64 free; /* number of free vals */
- TupleDesc tupdesc; /* row descriptor */
- HeapTuple *vals; /* rows */
+ uint64 alloced; /* # of alloced vals */
+ uint64 free; /* # of free vals */
+ slist_node next; /* link for internal bookkeeping */
+ SubTransactionId subid; /* subxact in which tuptable was created */
} SPITupleTable;
+ vals and tupdesc can
+ be used by SPI callers, the remaining fields are internal.
vals is an array of pointers to rows. (The number
of valid entries is given by SPI_processed.)
tupdesc is a row descriptor which you can pass to
- SPI functions dealing with rows. tuptabcxt,
- alloced, and free are internal
- fields not intended for use by SPI callers.
+ SPI functions dealing with rows.
typedef struct SPITupleTable
{
+ /* Public members */
+ TupleDesc tupdesc; /* tuple descriptor */
+ HeapTuple *vals; /* array of tuples */
+
+ /* Private members, not intended for external callers */
MemoryContext tuptabcxt; /* memory context of result table */
uint64 alloced; /* # of alloced vals */
uint64 free; /* # of free vals */
- TupleDesc tupdesc; /* tuple descriptor */
- HeapTuple *vals; /* tuples */
slist_node next; /* link for internal bookkeeping */
SubTransactionId subid; /* subxact in which tuptable was created */
} SPITupleTable;