Re: Bug in documentation: https://www.postgresql.org/docs/current/spi-examples.html

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Curt Kolovson <ckolovson(at)gmail(dot)com>, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: Bug in documentation: https://www.postgresql.org/docs/current/spi-examples.html
Date: 2023-07-18 02:21:45
Message-ID: CAKFQuwZ=pA_pNhvVFn-Cdto2vXbdFRJif8mXb4MB5PT5-KUGvQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Mon, Jul 17, 2023 at 6:22 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> "David G. Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com> writes:
> > On Mon, Jul 17, 2023 at 4:53 PM Curt Kolovson <ckolovson(at)gmail(dot)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?
>
>
Appears to be a documentation fix oversight back in v9.0

https://github.com/postgres/postgres/commit/2ddc600f8f0252a0864e85d5cc1eeb3b9687d7e9

We fixed the wording for the API argument but not the example that
demonstrated it.

David J.

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Tom Lane 2023-07-18 02:36:46 Re: Bug in documentation: https://www.postgresql.org/docs/current/spi-examples.html
Previous Message Curt Kolovson 2023-07-18 01:52:34 Re: Bug in documentation: https://www.postgresql.org/docs/current/spi-examples.html