Doc: fix out-of-date example of SPI usage.

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 2e9135b940936c2d6a08b397da495e0ebc016c40
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2023-07-18T15:59:39Z
Releases: 14.9
Doc: fix out-of-date example of SPI usage.

The "count" argument of SPI_exec() only limits execution when
the query is actually returning rows.  This was not the case
before PG 9.0, so this example was correct when written; but
we missed updating it in commit 2ddc600f8.  Extend the example
to show the behavior both with and without RETURNING.

While here, improve the commentary and markup for the rest
of the example.

David G. Johnston and Tom Lane, per report from Curt Kolovson.
Back-patch to all supported branches.

Discussion: https://postgr.es/m/CANhYJV6HWtgz_qjx_APfK0PAgLUzY-2vjLuj7i_o=TZF1LAQew@mail.gmail.com

Files

PathChange+/−
doc/src/sgml/spi.sgml modified +33 −15

Documentation touched

Discussion