Re: Bug in documentation: https://www.postgresql.org/docs/current/spi-examples.html
Curt Kolovson <ckolovson@gmail.com>
From: Curt Kolovson <ckolovson@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: "David G. Johnston" <david.g.johnston@gmail.com>,
pgsql-docs@lists.postgresql.org
Date: 2023-07-18T01:52:34Z
Lists: pgsql-docs
Tom is correct. It appears that nobody tested this example, which by the way seems unnecessarily complicated. Sent from my iPhone > On Jul 17, 2023, at 6:22 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote: > > "David G. Johnston" <david.g.johnston@gmail.com> writes: >>> On Mon, Jul 17, 2023 at 4:53 PM Curt Kolovson <ckolovson@gmail.com> wrote: >>> The actual results (shown below) are different than shown on this doc >>> page. > >> SPI_exec sees "INSERT 0 2" as the command tag from the SQL command you >> passed and so 2 is the output of the execq function call. >> No INFO messages appear because you did not include a returning clause. >> The 1 you passed to the call is immaterial if the query you supply doesn't >> produce a result set. > > I think his point is that this example does not behave as the > documentation claims. Which it does not, according to my > tests here. I find this a bit disturbing --- did we intentionally > change the behavior of SPI_exec somewhere along the line? > > regards, tom lane
Commits
-
Doc: fix out-of-date example of SPI usage.
- f9278cb0ae94 15.4 landed
- e6e451c1d7e5 16.0 landed
- df73e8bad6e4 11.21 landed
- dc2d9efcb47e 13.12 landed
- 2e9135b94093 14.9 landed
- 137b131d6fbd 17.0 landed
- 04911fa767fd 12.16 landed
-
Fix SPI documentation for new handling of ExecutorRun's count parameter.
- 2ddc600f8f02 9.3.0 cited