Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use SPITupleTable->numvals when available (#1037)
Starting from PostgreSQL, SPI tuple table contains number of rows returned in `numvals`, with `SPI_processed` still available for "historical reasons": "The fields tupdesc, vals, and numvals can be used by SPI callers; the remaining fields are internal. vals is an array of pointers to rows. The number of rows is given by numvals (for somewhat historical reasons, this count is also returned in SPI_processed)." (https://www.postgresql.org/docs/current/spi-spi-execute.html) Also: "Some utility commands (COPY, CREATE TABLE AS) don't return a row set, so SPI_tuptable is NULL, but they still return the number of rows processed in SPI_processed." So we're following this logic. This is to ensure we're not relying on "historical" API going forward.
- Loading branch information