]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Doc: fix out-of-date example of SPI usage.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 18 Jul 2023 15:59:39 +0000 (11:59 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 18 Jul 2023 15:59:39 +0000 (11:59 -0400)
commitdf73e8bad6e45195692aec3b316fd23acc71403a
tree4cf1fd33c439e0e2c6b3865bf7e8541b6eb105ce
parent6c7bffc096a65142fe6e461961dac50dec9bd75c
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
doc/src/sgml/spi.sgml